fix: Ignore DM messages and reactions in leveling system for guilds only
This commit is contained in:
parent
2609c6ea8b
commit
92c07a8430
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user