Files
Discord.Net/docs/guides/samples/dependency_map_setup.cs
Evan Sours 0e43d6c6f5 Fixed Install -> commands.LoadAssembly
await commands.LoadAssembly(Assembly.GetCurrentAssembly(), map);
->
await commands.AddModulesAsync(Assembly.GetEntryAssembly());
2016-12-03 17:44:32 -07:00

25 lines
674 B
C#

using Discord;
using Discord.Commands;
using Discord.WebSocket;
using foxboat.Services;
public class Commands
{
public async Task Install(DiscordSocketClient client)
{
var commands = new CommandService();
var map = new DependencyMap();
map.Add(client);
map.Add(commands);
await commands.AddModulesAsync(Assembly.GetEntryAssembly());
}
// In ConfigureServices, we will inject the Dependency Map with
// all of the services our client will use.
public Task ConfigureServices(IDependencyMap map)
{
map.Add(new NotificationService(map));
map.Add(new DatabaseService(map));
}
// ...
}