Пример #1
0
        public BanningHandler(IServiceProvider services, BanningService banningService)
        {
            _discord        = services.GetRequiredService <DiscordSocketClient>();
            _banningService = banningService;
            _guildId        = Configuration.GetVariable("Guild.Id");
            _adminChannelId = Configuration.GetVariable("Guild.AdminChannelId");
            _banTimer       = new Timer(OnBanCheckAsync, null, 10000, 600000);

            _discord.UserBanned   += OnUserBanned;
            _discord.UserUnbanned += OnUserUnbanned;
        }
Пример #2
0
 public BanningModule(ITimeProvider timeProvider, BanningService banningService)
 {
     _timeProvider   = timeProvider;
     _banningService = banningService;
     _adminChannelId = Configuration.GetVariable("Guild.AdminChannelId");
 }