mirror of
https://github.com/alterware/aw-bot.git
synced 2025-10-26 14:15:54 +00:00
maint: handle DMs
This commit is contained in:
@@ -32,6 +32,12 @@ ALLOWED_CHANNELS = [
|
||||
SPAM_ROLE_ID = 1350511935677927514
|
||||
|
||||
|
||||
async def handle_dm(message):
|
||||
await message.channel.send(
|
||||
"If you DM this bot again, I will carpet-bomb your house."
|
||||
)
|
||||
|
||||
|
||||
async def was_message_replied_by_bot(message, bot):
|
||||
"""
|
||||
Checks if a deleted message was replied to by a later message from the bot.
|
||||
@@ -225,6 +231,10 @@ async def handle_message(message, bot):
|
||||
if message.author == bot.user:
|
||||
return
|
||||
|
||||
if message.guild is None:
|
||||
await handle_dm(message)
|
||||
return
|
||||
|
||||
# Too many mentions
|
||||
if len(message.mentions) >= 3:
|
||||
member = message.guild.get_member(message.author.id)
|
||||
|
||||
Reference in New Issue
Block a user