From 7b19fa67e1557285123de5503eba6de7ce62597d Mon Sep 17 00:00:00 2001 From: insert Date: Tue, 14 May 2024 17:36:51 -0400 Subject: [PATCH] Final fix for execute --- applicationbot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/applicationbot.py b/applicationbot.py index cac96c7..e9756ac 100644 --- a/applicationbot.py +++ b/applicationbot.py @@ -105,7 +105,10 @@ async def whitelist( ) async def execute(inter: disnake.AppCmdInter, command:str): await inter.response.defer() - if int(os.getenv("ADMIN_ROLE_ID")) not in inter.user.roles: + guild = bot.get_guild(int(os.getenv("GUILD_ID"))) + member = await guild.fetch_member(inter.user.id) + role = guild.get_role(int(os.getenv("ADMIN_ROLE_ID"))) + if role not in member.roles: await inter.edit_original_response(content="Only the server admins may run this command") return with Client(os.getenv("RCON_IP"), int(os.getenv("RCON_PORT")), passwd=os.getenv("RCON_PASSWORD")) as client: