Add DM AI disable check for Gurt

This commit is contained in:
Slipstream 2025-06-09 17:27:12 +00:00
parent bd61f6d354
commit 1a5f99ad3c
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD

View File

@ -294,6 +294,11 @@ async def on_message_listener(cog: "GurtCog", message: discord.Message):
and message.reference.resolved.author == cog.bot.user
)
gurt_in_message = "gurt" in message.content.lower()
if message.guild is None and (bot_mentioned or replied_to_bot or gurt_in_message):
await message.channel.send("AI functionality is disabled in DMs.")
return
now = time.time()
time_since_last_activity = now - cog.channel_activity.get(channel_id, 0)
time_since_bot_spoke = now - cog.bot_last_spoke.get(channel_id, 0)