You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

dependency_map_setup.cs 674 B

123456789101112131415161718192021222324
  1. using Discord;
  2. using Discord.Commands;
  3. using Discord.WebSocket;
  4. using foxboat.Services;
  5. public class Commands
  6. {
  7. public async Task Install(DiscordSocketClient client)
  8. {
  9. var commands = new CommandService();
  10. var map = new DependencyMap();
  11. map.Add(client);
  12. map.Add(commands);
  13. await commands.AddModulesAsync(Assembly.GetEntryAssembly());
  14. }
  15. // In ConfigureServices, we will inject the Dependency Map with
  16. // all of the services our client will use.
  17. public Task ConfigureServices(IDependencyMap map)
  18. {
  19. map.Add(new NotificationService(map));
  20. map.Add(new DatabaseService(map));
  21. }
  22. // ...
  23. }