From a1498182d4c988fb07e98f4149d99fa33786b259 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Wed, 8 Mar 2023 21:42:48 -0500 Subject: [PATCH] actually actually final commit? --- galaxy/galaxy.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/galaxy/galaxy.py b/galaxy/galaxy.py index d566b48..6cb0d37 100644 --- a/galaxy/galaxy.py +++ b/galaxy/galaxy.py @@ -18,9 +18,13 @@ class Galaxy(commands.Cog): @commands.command() async def lwaccess(self, ctx): """You shouldn't be able to see this!""" - role = await bot.get_role(1083210988888784996) - await ctx.author.add_roles(role, reason="Requested through -lwaccess") - await ctx.send(content="Higher Access role granted.") + role = await ctx.guild.get_role(1083210988888784996) + if role in ctx.author.roles: + await ctx.author.removeroles(role, reaason="Requested through -lwaccess") + await ctx.send(content="Higher Access role removed.") + else: + await ctx.author.add_roles(role, reason="Requested through -lwaccess") + await ctx.send(content="Higher Access role added.") @commands.Cog.listener('on_message') async def cocoreact(self, message):