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

12345678910111213141516171819202122232425262728293031
  1. using Discord;
  2. using Discord.Commands;
  3. using Discord.WebSocket;
  4. public class ModuleA : ModuleBase
  5. {
  6. private readonly DatabaseService _database;
  7. public ModuleA(DatabaseService database)
  8. {
  9. _database = database;
  10. }
  11. public async Task ReadFromDb()
  12. {
  13. var x = _database.getX();
  14. await ReplyAsync(x);
  15. }
  16. }
  17. public class ModuleB
  18. {
  19. private CommandService _commands;
  20. private NotificationService _notification;
  21. public ModuleB(CommandService commands, IDependencyMap map)
  22. {
  23. _commands = commands;
  24. _notification = map.Get<NotificationService>();
  25. }
  26. }