Compare commits

...
2 Commits
Author SHA1 Message Date
imcompiling e35a2a8c8d Feat: Add autoban
build_develop / build (push) Successful in 38s
2025-07-16 15:55:09 -04:00
imcompiling d7046e4595 Add: config for ban channel id. 2025-07-16 15:45:35 -04:00
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -17,6 +17,7 @@ class ChannelIds:
event_post: int
general: int
voting: int
ban: int
@dataclass
@@ -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)