Skip to content

Commit

Permalink
Add help command to provide a list of available commands
Browse files Browse the repository at this point in the history
  • Loading branch information
y-u-s-u-f committed Mar 11, 2024
1 parent 7a12106 commit 392c024
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cogs/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ async def info(self, interaction: discord.Interaction):
embed.set_footer(text="Made with love by @yusuf.md")
await interaction.response.send_message(embed=embed)

@app_commands.command(name='help', description="Provides a list of all commands and their descriptions")
async def help(self, interaction: discord.Interaction):
embed = discord.Embed(title="Help", color=discord.Color.blue())

excluded_commands = ['sync', 'reload', 'purge', 'kick', 'ban', 'mute', 'unmute', 'warn']

for cog in self.bot.cogs.values():
for command in cog.get_app_commands():
if command.name not in excluded_commands:
embed.add_field(name=command.name, value=command.description, inline=True)

await interaction.response.send_message(embed=embed)

def get_uptime(self):
since = self.bot.start_time
now = datetime.datetime.now()
Expand Down

0 comments on commit 392c024

Please sign in to comment.