Skip to content

Commit

Permalink
Merge pull request #44 from Soapy7261/Python
Browse files Browse the repository at this point in the history
Thank you our lord and savior BARD.
  • Loading branch information
JoshuaSlui authored Apr 28, 2023
2 parents eb13468 + 62f7d4e commit e49b5dd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cogs/setserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit e49b5dd

Please sign in to comment.