コード例 #1
0
        public SelfcareBotMain(IServiceProvider serviceProvider, ILoggerFactory loggerFactory, IOptions <BotOptions> botOptions, ISelfcareDbContext selfcareDb, ILogger <SelfcareBotMain> logger)
        {
            _selfcareDb = selfcareDb;
            _logger     = logger;

            // Create discord client
            _discord = new DiscordClient(
                new DiscordConfiguration
            {
                Token         = botOptions.Value.DiscordToken,
                TokenType     = TokenType.Bot,
                LoggerFactory = loggerFactory
            }
                );

            // Enable interactivity
            _discord.UseInteractivity(
                new InteractivityConfiguration
            {
                PollBehaviour = PollBehaviour.KeepEmojis
            }
                );

            // Register commands
            _discord.UseCommandsNext(
                new CommandsNextConfiguration
            {
                StringPrefixes = botOptions.Value.CommandPrefixes,
                Services       = serviceProvider
            }
                )
            .RegisterCommands(Assembly.GetExecutingAssembly());
        }
コード例 #2
0
 public UserService(ISelfcareDbContext selfcareDb)
 {
     _selfcareDb = selfcareDb;
 }
コード例 #3
0
 public HydrationLeaderboard(ISelfcareDbContext selfcareDb, IUserService userService)
 {
     _selfcareDb  = selfcareDb;
     _userService = userService;
 }