From d130df1a63ad4fca26ba997098623afa22274884 Mon Sep 17 00:00:00 2001 From: Soapy7261 Official <81933267+Soapy7261@users.noreply.github.com> Date: Fri, 28 Apr 2023 12:28:26 -0400 Subject: [PATCH] thank you BARD. --- cogs/setserver.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cogs/setserver.py b/cogs/setserver.py index 3fd22eb..e7abb24 100644 --- a/cogs/setserver.py +++ b/cogs/setserver.py @@ -5,10 +5,19 @@ class SetServer(commands.Cog): def __init__(self, bot): self.bot = bot + def has_manage_guild_permission(self, ctx): #Credits to the google AI BARD for generating this code, i don't know why py-cord's built in method didn't work= + author = ctx.author + + # Get the author's guild permissions + permissions = author.guild_permissions + + # Check if the author has the manage guild permission + return permissions.manage_guild + @bridge.bridge_command(aliases=["set"], description="Set the default server to use if no argument is provided in the status command.") async def setserver(self, ctx, server=None): - if not ctx.author.guild_permissions.manage_guild: + if not self.has_manage_guild_permission(ctx): return await ctx.respond("You need the `Manage Server` permission to use this command.") if server is None: return await ctx.respond(