Birthday troll.
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
Defines cog for on message listener.
|
||||
"""
|
||||
|
||||
from datetime import date
|
||||
import random
|
||||
import re
|
||||
|
||||
from nextcord.ext import commands
|
||||
@@ -22,7 +24,19 @@ class SubmissionListener(commands.Cog, name="Message Listener"):
|
||||
@commands.Cog.listener()
|
||||
async def on_message(self, message: nextcord.Message):
|
||||
"""Listener for message creation. Adds score and attachments to submission."""
|
||||
# don't want to process any messages from bot.
|
||||
if message.author.id == self.bot.user.id:
|
||||
return
|
||||
|
||||
guild_id = message.guild.id
|
||||
|
||||
# troll addition for friends birthday
|
||||
if guild_id == 239758371358638080 and date.today() == date(2022, 7, 31):
|
||||
# 5% chance to send the message
|
||||
chance = random.randint(1, 20)
|
||||
if chance == 1:
|
||||
await message.channel.send("Happy Birthday Chris <@642330132958281750>")
|
||||
|
||||
if message.author.id in submission_objects:
|
||||
message_id = submission_objects[message.author.id]["message_id"]
|
||||
submission_channel_id = highscores_data.get_guild_submission_channel(guild_id)
|
||||
|
||||
Reference in New Issue
Block a user