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(