Files
Discord.Net/docs/guides/samples/dependency_map_setup.cs

17 lines
458 B
C#

using Discord;
using Discord.Commands;
using Discord.WebSocket;
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);
}
// ...
}