Example #1
0
        public CommandHandler(IServiceProvider services, MajorContext config, DiscordSocketClient client, CommandService commands, ILogger <CommandHandler> logger)
        {
            _services = services;
            _config   = config;

            _client   = client;
            _commands = commands;
            Log       = logger;

            _client.MessageReceived += MessageReceived;
        }
Example #2
0
        public MajorBot(IServiceProvider services, MajorContext context)
        {
            _provider = services;
            _context  = context;

            _applicationConfig   = _provider.GetRequiredService <IOptions <MajorConfig> >().Value;
            _client              = _provider.GetRequiredService <DiscordSocketClient>();
            _commands            = _provider.GetRequiredService <CommandService>();
            _applicationLifetime = _provider.GetRequiredService <IHostApplicationLifetime>();
            _serilogAdapter      = new DiscordSerilogAdapter(_provider.GetRequiredService <ILogger <DiscordSerilogAdapter> >());
            Log = _provider.GetRequiredService <ILogger <MajorBot> >();

            // Just construct it so we have a concrete reference to it.
            _provider.GetRequiredService <CommandHandler>();
        }
Example #3
0
 public RolesModule(MajorContext dbContext, ILogger <RolesModule> logger)
 {
     _dbContext = dbContext;
     Log        = logger;
 }
Example #4
0
 public HelpModule(ICommandHelpService commandHelpService, MajorContext config)
 {
     _commandHelpService = commandHelpService;
     _config             = config;
 }
Example #5
0
 public CommandChannelModule(MajorContext context)
 {
     _context = context;
 }
Example #6
0
 public GuildModule(MajorContext context)
 {
     _context = context;
 }
Example #7
0
 public GreetingModule(MajorContext context, IHostEnvironment environment, IServiceProvider services)
 {
     _context     = context;
     _environment = environment;
     _services    = services;
 }
Example #8
0
 public GeneralModule(DiscordSocketClient discordClient, MajorContext dbContext)
 {
     _discordClient = discordClient;
     _dbContext     = dbContext;
 }