Compare commits

..

No commits in common. "00cdad31457da68a864b4505ea4116e22fcafbea" and "331e0e10a7d5b7305cfe6831e1d0e1d6a9f8e69d" have entirely different histories.

View File

@ -139,7 +139,7 @@ async def hello_command(ctx: commands.Context, name: str = "World") -> None:
"""Say hello to someone.""" """Say hello to someone."""
await ctx.send(f"Hello, {name}!") await ctx.send(f"Hello, {name}!")
@bot.command(name="list-commands", description="List all available commands.") @bot.command(name="help", description="List all available commands.")
async def help_command(ctx: commands.Context) -> None: async def help_command(ctx: commands.Context) -> None:
"""List all available commands.""" """List all available commands."""
# Get all registered commands (both prefix and slash) # Get all registered commands (both prefix and slash)
@ -147,7 +147,7 @@ async def help_command(ctx: commands.Context) -> None:
cmd_list = [] cmd_list = []
for cmd in cmds: for cmd in cmds:
cmd_list.append(f" `{cmd.name}` — {cmd.description}") cmd_list.append(f" `{cmd.name}` — {cmd.description}")
await ctx.send( await ctx.send(
f"**{bot.user.name} — Command List**\n\n" f"**{bot.user.name} — Command List**\n\n"
+ "\n".join(cmd_list) + "\n".join(cmd_list)
@ -205,7 +205,7 @@ async def on_message(message: discord.Message) -> None:
if message.author == bot.user: if message.author == bot.user:
return return
# Ignore messages in DMs # Check if the message is in a guild (server)
if message.guild is None: if message.guild is None:
return return