diff --git a/bot/events.py b/bot/events.py index 69ee01e..ce72cbe 100644 --- a/bot/events.py +++ b/bot/events.py @@ -40,8 +40,4 @@ async def setup(bot): async def on_message_edit(before, after): await handle_message_edit(before, after, bot) - @bot.event - async def on_voice_state_update(member, before, after): - await handle_voice_state_update(member, before, after, bot) - logger.info("Events extension loaded!") diff --git a/bot/events_handlers/message_events.py b/bot/events_handlers/message_events.py index a753207..e4f8e50 100644 --- a/bot/events_handlers/message_events.py +++ b/bot/events_handlers/message_events.py @@ -25,6 +25,11 @@ SPAM_ROLE_ID = 1350511935677927514 ADMIN_ROLE_ID = 1112364483915042908 GROK_ROLE_ID = 1362837967919386916 +GHOST_CHANNEL_ID = 1145469106133401682 +AW_CHANNEL_ID = 1145469136919613551 +DEPRECATED_SUPPORT_CHANNELS = [GHOST_CHANNEL_ID, AW_CHANNEL_ID] +deprecated_support_last_response_time = None + ALLOWED_CHANNELS = [ 1112048063448617142, # off-topic 1119371841711112314, # vip-channel @@ -98,6 +103,26 @@ async def handle_at_everyone(message): return False +async def handle_deprecated_support_channel(message): + global deprecated_support_last_response_time + + if message.channel.id in DEPRECATED_SUPPORT_CHANNELS: + now = aware_utcnow() + if ( + deprecated_support_last_response_time is None + or now - deprecated_support_last_response_time >= timedelta(minutes=10) + ): + deprecated_support_last_response_time = now + await message.reply( + "Do not ask for support in this channel because the client is no longer " + "working. See our announcement channel.", + mention_author=True, + ) + return True + + return False + + def fetch_image_from_message(message): image_object = None for attachment in message.attachments: @@ -471,6 +496,9 @@ async def handle_message(message, bot): await is_message_a_duplicate(message) + if await handle_deprecated_support_channel(message): + return + if ( "http" in message.content and not message.embeds diff --git a/bot/tasks.py b/bot/tasks.py index 053f0b2..e4c42f2 100644 --- a/bot/tasks.py +++ b/bot/tasks.py @@ -18,8 +18,6 @@ SPAM_ROLE_ID = 1350511935677927514 COD_GAMES = { 10180: {"name": "Modern Warfare 2 (2009)", "channel": 1145458108190163014}, 42680: {"name": "Modern Warfare 3 (2011)", "channel": 1145459504436220014}, - 209160: {"name": "Call of Duty: Ghosts", "channel": 1145469106133401682}, - 209650: {"name": "Call of Duty: Advanced Warfare", "channel": 1145469136919613551}, 311210: {"name": "Call of Duty: Black Ops 3", "channel": 1180796251529293844}, }