Update doc samples for correctness, consistency, and a better complete quickstart example.

This commit is contained in:
Joe4evr
2017-01-31 02:28:53 +01:00
parent 4cf6d8e03f
commit 02969ff7b5
4 changed files with 124 additions and 41 deletions

View File

@@ -7,18 +7,13 @@ 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());
// Here, we will inject the Dependency Map with
// all of the services our client will use.
_map.Add(client);
_map.Add(commands);
_map.Add(new NotificationService(_map));
_map.Add(new DatabaseService(_map));
// ...
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));
}
// ...
}