Skip to content

Commit e49b5dd

Browse files
authored
Merge pull request #44 from Soapy7261/Python
Thank you our lord and savior BARD.
2 parents eb13468 + 62f7d4e commit e49b5dd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

cogs/setserver.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,19 @@ class SetServer(commands.Cog):
55
def __init__(self, bot):
66
self.bot = bot
77

8+
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=
9+
author = ctx.author
10+
11+
# Get the author's guild permissions
12+
permissions = author.guild_permissions
13+
14+
# Check if the author has the manage guild permission
15+
return permissions.manage_guild
16+
817
@bridge.bridge_command(aliases=["set"],
918
description="Set the default server to use if no argument is provided in the status command.")
1019
async def setserver(self, ctx, server=None):
11-
if not ctx.author.guild_permissions.manage_guild:
20+
if not self.has_manage_guild_permission(ctx):
1221
return await ctx.respond("You need the `Manage Server` permission to use this command.")
1322
if server is None:
1423
return await ctx.respond(

0 commit comments

Comments
 (0)