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 623 B

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