docs: Improve IF cmd execution docs (#2405)
Adds samples and better explains workflow.
This commit is contained in:
14
docs/guides/int_framework/samples/intro/event.cs
Normal file
14
docs/guides/int_framework/samples/intro/event.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
// Theres multiple ways to subscribe to the event, depending on your application. Please use the approach fit to your type of client.
|
||||
// DiscordSocketClient:
|
||||
_socketClient.InteractionCreated += async (x) =>
|
||||
{
|
||||
var ctx = new SocketInteractionContext(_socketClient, x);
|
||||
await _interactionService.ExecuteCommandAsync(ctx, _serviceProvider);
|
||||
}
|
||||
|
||||
// DiscordShardedClient:
|
||||
_shardedClient.InteractionCreated += async (x) =>
|
||||
{
|
||||
var ctx = new ShardedInteractionContext(_shardedClient, x);
|
||||
await _interactionService.ExecuteCommandAsync(ctx, _serviceProvider);
|
||||
}
|
||||
Reference in New Issue
Block a user