Пример #1
0
        public EventHandlerService(DiscordSocketClient client)
        {
            _client = client;

            // assisting handlers
            _wordFilterService        = new WordFilterService();
            _nicknameAlertService     = new NicknameAlertService(new FloofDataContext());
            _raidProtectionService    = new RaidProtectionService();
            _userRoleRetentionService = new UserRoleRetentionService(new FloofDataContext());
            _welcomeGateService       = new WelcomeGateService(new FloofDataContext());

            // event handlers
            _client.MessageUpdated     += MessageUpdated;
            _client.MessageDeleted     += MessageDeleted;
            _client.UserBanned         += UserBanned;
            _client.UserUnbanned       += UserUnbanned;
            _client.UserJoined         += UserJoined;
            _client.UserLeft           += UserLeft;
            _client.GuildMemberUpdated += GuildMemberUpdated;
            _client.GuildMemberUpdated += _welcomeGateService.HandleWelcomeGate; // welcome gate handler
            _client.UserUpdated        += UserUpdated;
            _client.MessageReceived    += OnMessage;
            _client.MessageReceived    += RulesGate; // rfurry rules gate
            _client.ReactionAdded      += _nicknameAlertService.OnReactionAdded;

            // a list of announcement channels for auto publishing
            announcementChannels = BotConfigFactory.Config.AnnouncementChannels;
        }
Пример #2
0
        public EventLoggerService(DiscordSocketClient client)
        {
            _client = client;

            // assisting handlers
            _wordFilterService    = new WordFilterService();
            _nicknameAlertService = new NicknameAlertService(new FloofDataContext());

            // event handlers
            _client.MessageUpdated     += MessageUpdated;
            _client.MessageDeleted     += MessageDeleted;
            _client.UserBanned         += UserBanned;
            _client.UserUnbanned       += UserUnbanned;
            _client.UserJoined         += UserJoined;
            _client.UserLeft           += UserLeft;
            _client.GuildMemberUpdated += GuildMemberUpdated;
            _client.MessageReceived    += OnMessage;
            _client.ReactionAdded      += _nicknameAlertService.OnReactionAdded;
        }