Compare commits
20
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a15a35fcda | ||
|
|
44baf01a51 | ||
|
|
abc2950b21 | ||
|
|
1cc46ce2fd | ||
|
|
bb2d6b62fe | ||
|
|
77ce54f383 | ||
|
|
f81ebca4de | ||
|
|
2e66b1c37c | ||
|
|
ae1f98abe3 | ||
|
|
490c30e88c | ||
|
|
35670358c4 | ||
|
|
7a59f3b453 | ||
|
|
e01ab64411 | ||
|
|
df482d80f0 | ||
|
|
0d06d98060 | ||
|
|
c267762efa | ||
|
|
e837cec46b | ||
|
|
0a856755c8 | ||
|
|
eb8cfee7fd | ||
|
|
6b5dc771d4 |
@@ -4,7 +4,6 @@ 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"):
|
||||
@@ -17,15 +16,7 @@ class SubmissionListener(commands.Cog, name="Message Listener"):
|
||||
async def on_message(self, message: nextcord.Message) -> None:
|
||||
"""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: # pyright: ignore[reportOptionalMemberAccess]
|
||||
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_seconds=30 * 60, reason="Probable spam. The ban channel was messaged."
|
||||
)
|
||||
if message.author.id == self.bot.user.id:
|
||||
return
|
||||
|
||||
await birthday_action(message)
|
||||
@@ -40,7 +31,7 @@ def setup(bot: commands.Bot) -> None:
|
||||
|
||||
async def birthday_action(message: nextcord.Message) -> None:
|
||||
"""
|
||||
Checks a message's author and mentions to see if they are in the birthday list.
|
||||
Checks a message's auther and mentions to see if they are in the birthday list.
|
||||
|
||||
Args:
|
||||
message (nextcord.Message): The message to check for a birthday person.
|
||||
|
||||
@@ -17,7 +17,6 @@ class ChannelIds:
|
||||
event_post: int
|
||||
general: int
|
||||
voting: int
|
||||
ban: int
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
Reference in New Issue
Block a user