mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 03:40:11 +01:00
feat: make help commands ephemeral
This commit is contained in:
@@ -88,7 +88,10 @@ class Help(commands.Cog, name="help"):
|
|||||||
inline=False
|
inline=False
|
||||||
)
|
)
|
||||||
|
|
||||||
await context.send(embed=embed)
|
if context.interaction:
|
||||||
|
await context.interaction.response.send_message(embed=embed, ephemeral=True)
|
||||||
|
else:
|
||||||
|
await context.author.send(embed=embed)
|
||||||
return
|
return
|
||||||
|
|
||||||
category = category.lower()
|
category = category.lower()
|
||||||
@@ -98,7 +101,10 @@ class Help(commands.Cog, name="help"):
|
|||||||
description=f"Category '{category}' not found. Use `/help` to see available categories.",
|
description=f"Category '{category}' not found. Use `/help` to see available categories.",
|
||||||
color=0xE02B2B
|
color=0xE02B2B
|
||||||
)
|
)
|
||||||
await context.send(embed=embed)
|
if context.interaction:
|
||||||
|
await context.interaction.response.send_message(embed=embed, ephemeral=True)
|
||||||
|
else:
|
||||||
|
await context.author.send(embed=embed)
|
||||||
return
|
return
|
||||||
|
|
||||||
if category == "owner" and not (await self.bot.is_owner(context.author)):
|
if category == "owner" and not (await self.bot.is_owner(context.author)):
|
||||||
@@ -107,7 +113,10 @@ class Help(commands.Cog, name="help"):
|
|||||||
description="You don't have permission to view owner commands.",
|
description="You don't have permission to view owner commands.",
|
||||||
color=0xE02B2B
|
color=0xE02B2B
|
||||||
)
|
)
|
||||||
await context.send(embed=embed)
|
if context.interaction:
|
||||||
|
await context.interaction.response.send_message(embed=embed, ephemeral=True)
|
||||||
|
else:
|
||||||
|
await context.author.send(embed=embed)
|
||||||
return
|
return
|
||||||
|
|
||||||
commands_in_category = []
|
commands_in_category = []
|
||||||
@@ -126,11 +135,14 @@ class Help(commands.Cog, name="help"):
|
|||||||
description=f"No commands found in category '{category}'.",
|
description=f"No commands found in category '{category}'.",
|
||||||
color=0xE02B2B
|
color=0xE02B2B
|
||||||
)
|
)
|
||||||
await context.send(embed=embed)
|
if context.interaction:
|
||||||
|
await context.interaction.response.send_message(embed=embed, ephemeral=True)
|
||||||
|
else:
|
||||||
|
await context.author.send(embed=embed)
|
||||||
return
|
return
|
||||||
|
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title="Help",
|
title=f"Help » {category.capitalize()}",
|
||||||
color=0xBEBEFE
|
color=0xBEBEFE
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -140,12 +152,15 @@ class Help(commands.Cog, name="help"):
|
|||||||
|
|
||||||
help_text = "\n".join(data)
|
help_text = "\n".join(data)
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name=f"{category.capitalize()} Commands",
|
name="",
|
||||||
value=help_text,
|
value=help_text,
|
||||||
inline=False
|
inline=False
|
||||||
)
|
)
|
||||||
|
|
||||||
await context.send(embed=embed)
|
if context.interaction:
|
||||||
|
await context.interaction.response.send_message(embed=embed, ephemeral=True)
|
||||||
|
else:
|
||||||
|
await context.author.send(embed=embed)
|
||||||
|
|
||||||
|
|
||||||
async def setup(bot) -> None:
|
async def setup(bot) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user