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_module.cs 648 B

1234567891011121314151617181920212223242526272829
  1. using Discord;
  2. using Discord.Commands;
  3. using Discord.WebSocket;
  4. [Module]
  5. public class ModuleA
  6. {
  7. private DiscordSocketClient client;
  8. private ISelfUser self;
  9. public ModuleA(IDiscordClient c, ISelfUser s)
  10. {
  11. if (!(c is DiscordSocketClient)) throw new InvalidOperationException("This module requires a DiscordSocketClient");
  12. client = c as DiscordSocketClient;
  13. self = s;
  14. }
  15. }
  16. public class ModuleB
  17. {
  18. private IDiscordClient client;
  19. private CommandService commands;
  20. public ModuleB(CommandService c, IDependencyMap m)
  21. {
  22. commands = c;
  23. client = m.Get<IDiscordClient>();
  24. }
  25. }