From 56f5d23e209f8102794df5d0664fd70264cb731f Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 2 Sep 2021 03:44:47 +0200 Subject: [PATCH] fix fetching role --- src/cogs/confreriedukassoulait.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cogs/confreriedukassoulait.py b/src/cogs/confreriedukassoulait.py index 75d521a..adfcdd6 100644 --- a/src/cogs/confreriedukassoulait.py +++ b/src/cogs/confreriedukassoulait.py @@ -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]))