Skip to content

Commit

Permalink
Merge pull request #98 from Vatsim-Scandinavia/feature/training-roles
Browse files Browse the repository at this point in the history
Removed debug
  • Loading branch information
Marko259 authored Sep 27, 2024
2 parents 9aebc99 + 5542e62 commit c607ebf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
8 changes: 0 additions & 8 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ async def on_ready() -> None:
await bot.change_presence(activity=config.activity(), status=config.status())
await bot.tree.sync() # Sync global commands (might take up to 1 hour to reflect globally)

guild = bot.get_guild(GUILD_ID)
bot_member = guild.get_member(bot.user.id)

if bot_member.guild_permissions.administrator or bot_member.guild_permissions.manage_guild:
await print("Bot has the required permissions to sync commands.", flush=True)
else:
await print("Bot is missing required permissions.", flush=True)

except BadArgument as e:
print(f'Error changing presence. Exception - {e}', flush=True)
except discord.HTTPException as e:
Expand Down
7 changes: 1 addition & 6 deletions cogs/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async def user_check(self, interaction: discord.Integration):

async def sync_commands(self, override=False):
now = datetime.now().isoformat()
guild = discord.Object(id=GUILD_ID)
guild = self.bot.get_guild(id=GUILD_ID)
bot_member = guild.get_member(self.bot.user.id)

try:
Expand All @@ -114,11 +114,6 @@ async def sync_commands(self, override=False):
await self.bot.tree.sync(guild=guild) # Sync commands to a specific guild for faster deployment
else:
await self.bot.tree.sync() # Sync global commands (might take up to 1 hour to reflect globally)

if bot_member.guild_permissions.administrator or bot_member.guild_permissions.manage_guild:
await print("Bot has the required permissions to sync commands.", flush=True)
else:
await print("Bot is missing required permissions.", flush=True)
except discord.HTTPException as e:
print(f"Failed to sync commands due to rate limiting: {e}")

Expand Down

0 comments on commit c607ebf

Please sign in to comment.