You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cogs/setserver.py
+10-1Lines changed: 10 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,19 @@ class SetServer(commands.Cog):
5
5
def__init__(self, bot):
6
6
self.bot=bot
7
7
8
+
defhas_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
+
returnpermissions.manage_guild
16
+
8
17
@bridge.bridge_command(aliases=["set"],
9
18
description="Set the default server to use if no argument is provided in the status command.")
10
19
asyncdefsetserver(self, ctx, server=None):
11
-
ifnotctx.author.guild_permissions.manage_guild:
20
+
ifnotself.has_manage_guild_permission(ctx):
12
21
returnawaitctx.respond("You need the `Manage Server` permission to use this command.")
0 commit comments