Files
Discord.Net/docs/guides/samples/dependency_map_setup.cs
Christopher F 77342903bb Update Documentation to be compatible with Beta2
this one took a while
2016-10-15 17:28:36 -04:00

24 lines
677 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.LoadAssembly(Assembly.GetCurrentAssembly(), map);
}
// 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));
}
// ...
}