mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 03:40:11 +01:00
refactor: (description) owner command handling && fix colors
Standardized embed colors to Discord blurple (0x7289DA) across all cogs. Refactored owner command modules (say, shutdown, sync) to use a shared send_embed helper and improved error handling for permission checks. Updated botinfo title and improved bot owner/team logging in bot.py. Help command now always lists 'owner' category, removing permission checks from category display.
This commit is contained in:
@@ -19,7 +19,7 @@ class BotInfo(commands.Cog, name="botinfo"):
|
||||
:param context: The hybrid command context.
|
||||
"""
|
||||
embed = discord.Embed(
|
||||
title="Nyrix Discord Bot",
|
||||
title="Syntrel Discord Bot",
|
||||
color=0x7289DA,
|
||||
)
|
||||
embed.set_author(name="Bot Information", icon_url="https://yes.nighty.works/raw/y5SEZ9.webp")
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
# embed = discord.Embed(
|
||||
# title="Message without spoilers",
|
||||
# description=message.content.replace("||", ""),
|
||||
# color=0xBEBEFE,
|
||||
# color=0x7289DA,
|
||||
# )
|
||||
# if spoiler_attachment is not None:
|
||||
# embed.set_image(url=attachment.url)
|
||||
@@ -52,7 +52,7 @@
|
||||
# """
|
||||
# embed = discord.Embed(
|
||||
# description=f"The ID of {user.mention} is `{user.id}`.",
|
||||
# color=0xBEBEFE,
|
||||
# color=0x7289DA,
|
||||
# )
|
||||
# await interaction.response.send_message(embed=embed, ephemeral=True)
|
||||
#
|
||||
|
||||
@@ -13,10 +13,7 @@ class Help(commands.Cog, name="help"):
|
||||
interaction: discord.Interaction,
|
||||
current: str,
|
||||
) -> list[app_commands.Choice[str]]:
|
||||
categories = ["general", "fun", "moderation", "template"]
|
||||
|
||||
if await self.bot.is_owner(interaction.user):
|
||||
categories.append("owner")
|
||||
categories = ["general", "fun", "moderation", "template", "owner"]
|
||||
|
||||
suggestions = []
|
||||
for category in categories:
|
||||
@@ -85,8 +82,6 @@ class Help(commands.Cog, name="help"):
|
||||
for cog_name in self.bot.cogs:
|
||||
mapped_category = category_mapping.get(cog_name.lower())
|
||||
if mapped_category:
|
||||
if mapped_category == "owner" and not (await self.bot.is_owner(context.author)):
|
||||
continue
|
||||
available_categories.add(mapped_category)
|
||||
|
||||
category_list = []
|
||||
@@ -120,17 +115,6 @@ class Help(commands.Cog, name="help"):
|
||||
await context.author.send(embed=embed)
|
||||
return
|
||||
|
||||
if category == "owner" and not (await self.bot.is_owner(context.author)):
|
||||
embed = discord.Embed(
|
||||
title="Error",
|
||||
description="You don't have permission to view owner commands.",
|
||||
color=0x7289DA
|
||||
)
|
||||
if context.interaction:
|
||||
await context.interaction.response.send_message(embed=embed, ephemeral=True)
|
||||
else:
|
||||
await context.author.send(embed=embed)
|
||||
return
|
||||
|
||||
commands_in_category = []
|
||||
seen_names = set()
|
||||
|
||||
@@ -28,7 +28,7 @@ class Ping(commands.Cog, name="ping"):
|
||||
embed = discord.Embed(
|
||||
title="🏓 Pong!",
|
||||
description=f"The bot latency is {round(self.bot.latency * 1000)}ms.",
|
||||
color=0xBEBEFE,
|
||||
color=0x7289DA,
|
||||
)
|
||||
embed.set_author(name="Ping", icon_url="https://yes.nighty.works/raw/y5SEZ9.webp")
|
||||
if getattr(context, "interaction", None):
|
||||
|
||||
Reference in New Issue
Block a user