reacts when dm'd or pinged

This commit is contained in:
thom2305 2025-04-23 08:51:56 -04:00
parent 6d969f1dd7
commit dc9a26e135
No known key found for this signature in database
GPG Key ID: 0171038FEE1BEF12

18
bot.py
View File

@ -551,6 +551,24 @@ async def addfc(ctx, user: discord.Member, fc: int):
conn.close()
await ctx.send(f"Added <@{userid}> friend code", ephemeral=True)
@bot.event
async def on_message(message):
if bot.user.mentioned_in(message) and message.guild:
try:
await message.add_reaction('👀')
await message.reply("Please dont ping me...")
except Exception as e:
print(f'Failed to react to mention: {e}')
if isinstance(message.channel, discord.DMChannel) and message.author != bot.user:
try:
await message.add_reaction('👀')
await message.reply("Dont dm me please... If you have an issue, make a post in <#1350084638726553632> or send an email to us at support@wiimart.org")
except Exception as e:
print(f'Failed to react to DM: {e}')
await bot.process_commands(message)
try:
os.remove("error_codes.db")
except Exception as e: