Add docs for the Command Service
This commit is contained in:
16
docs/guides/samples/dependency_map_setup.cs
Normal file
16
docs/guides/samples/dependency_map_setup.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Discord;
|
||||
using Discord.Commands;
|
||||
|
||||
public class Commands
|
||||
{
|
||||
public async Task Install(DiscordSocketClient client)
|
||||
{
|
||||
var commands = new CommandService();
|
||||
var map = new DependencyMap();
|
||||
map.Add<IDiscordClient>(client);
|
||||
var self = await client.GetCurrentUserAsync();
|
||||
map.Add<ISelfUser>(self);
|
||||
await commands.LoadAssembly(Assembly.GetCurrentAssembly(), map);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
Reference in New Issue
Block a user