Feat: Add autoban
build_develop / build (push) Successful in 38s

This commit is contained in:
2025-07-16 15:55:09 -04:00
parent d7046e4595
commit e35a2a8c8d
@@ -4,6 +4,7 @@ import nextcord
from nextcord.ext import commands
from dakiny_bot.app import birthday_list
from dakiny_bot.DakinySettings import settings
class SubmissionListener(commands.Cog, name="Message Listener"):
@@ -19,6 +20,14 @@ class SubmissionListener(commands.Cog, name="Message Listener"):
if message.author.id == self.bot.user.id:
return
# Ban all members who message in this channel. Everyone in guild is a member, so shouldn't miss a ban
# due to message.author not being a nextcord.Member object.
if message.channel.id == settings.channel_ids.ban and isinstance(message.author, nextcord.Member):
await message.author.ban(
delete_message_days=1, reason=f"{message.author.nick} messaged in the ban channel!"
)
return
await birthday_action(message)