fix fetching role
This commit is contained in:
parent
65e0e25e32
commit
56f5d23e20
1 changed files with 2 additions and 2 deletions
|
@ -127,7 +127,7 @@ class ConfrerieDuKassoulait(commands.Cog):
|
|||
self.emoji_to_role[payload.emoji.id]
|
||||
except KeyError:
|
||||
return
|
||||
await payload.member.add_roles(self.client.get_role(self.emoji_to_role[payload.emoji.id]))
|
||||
await payload.member.add_roles(payload.member.guild.get_role(self.emoji_to_role[payload.emoji.id]))
|
||||
|
||||
@commands.Cog.listener()
|
||||
async def on_raw_reaction_remove(self, payload):
|
||||
|
@ -139,4 +139,4 @@ class ConfrerieDuKassoulait(commands.Cog):
|
|||
return
|
||||
guild = discord.utils.find(lambda g: g.id == payload.guild_id, self.client.guilds)
|
||||
member = discord.utils.find(lambda m: m.id == payload.user_id, guild.members)
|
||||
await member.remove_roles(self.client.get_role(self.emoji_to_role[payload.emoji.id]))
|
||||
await member.remove_roles(guild.get_role(self.emoji_to_role[payload.emoji.id]))
|
||||
|
|
Reference in a new issue