From 3adb157a9690b25b75109ff08c3ebef80e6a58c5 Mon Sep 17 00:00:00 2001 From: Ryry013 <30587035+ryry013@users.noreply.github.com> Date: Mon, 8 Jul 2024 11:11:14 -0700 Subject: [PATCH] Create ;admin command for attachment of admin role --- cogs/general.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cogs/general.py b/cogs/general.py index 01a4dfa..a0046ec 100644 --- a/cogs/general.py +++ b/cogs/general.py @@ -1446,6 +1446,20 @@ async def doneq(self, ctx: commands.Context): except (discord.Forbidden, discord.HTTPException): pass + @commands.command(hidden=True) + @commands.check(lambda ctx: ctx.author.id in [216848576549093376, 354352443502493706, 202995638860906496] + and ctx.guild.id == SP_SERVER_ID if ctx.guild else False) + async def admin(self, ctx): + """Allows chosen users to add/remove admin role""" + # Current users: Jaleel, Evil, Ryan + admin_role = ctx.guild.get_role(243854949522472971) + if admin_role in ctx.author.roles: + await ctx.author.remove_roles(admin_role) + await ctx.message.add_reaction('❌') + else: + await ctx.author.add_roles(admin_role) + await ctx.message.add_reaction('✅') + async def setup(bot): await bot.add_cog(General(bot))