Getting better check

Removing indentation level
pull/8/head
sgoudham 4 years ago
parent c006b17330
commit 1ef87c257b

@ -142,7 +142,7 @@ def SendMsgToModMail(self, msg, author):
# Set up the Cog # Set up the Cog
class Modmail(commands.Cog): class modmail(commands.Cog):
def __init__(self, bot): def __init__(self, bot):
self.bot = bot self.bot = bot
self.anon = None self.anon = None
@ -150,17 +150,10 @@ class Modmail(commands.Cog):
# Setting up Listener to listen for reactions within the modmail channel created # Setting up Listener to listen for reactions within the modmail channel created
@commands.Cog.listener() @commands.Cog.listener()
async def on_raw_reaction_add(self, payload): async def on_raw_reaction_add(self, payload):
self.anon = None # Don't count reactions that are made by the bot
m = payload.member if payload.user_id == self.bot.user.id:
# A check that makes sure that the reaction is done by the bot
def check(m):
return m == self.bot.user
# If the member is not a user, do nothing
if check(m):
return return
else:
# Find a role corresponding to the Emoji name. # Find a role corresponding to the Emoji name.
guildid = payload.guild_id guildid = payload.guild_id
@ -373,4 +366,4 @@ class Modmail(commands.Cog):
def setup(bot): def setup(bot):
bot.add_cog(Modmail(bot)) bot.add_cog(modmail(bot))

Loading…
Cancel
Save