fix: Ignore DM messages and reactions in leveling system for guilds only

This commit is contained in:
Slipstream 2025-05-26 15:49:43 -06:00
parent 2609c6ea8b
commit 92c07a8430
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD

View File

@ -297,6 +297,10 @@ class LevelingCog(commands.Cog):
if message.author.bot:
return
# Ignore DM messages (leveling is only for guilds)
if not message.guild:
return
# Ignore messages in restricted channels
if message.channel.id in self.restricted_channels:
return
@ -553,6 +557,10 @@ class LevelingCog(commands.Cog):
if not self.config["reaction_xp_enabled"]:
return
# Ignore DM reactions (leveling is only for guilds)
if not payload.guild_id:
return
# Ignore bot reactions
if payload.member and payload.member.bot:
return