Skip to content

Commit

Permalink
format the code
Browse files Browse the repository at this point in the history
  • Loading branch information
aydenjahola committed Nov 12, 2024
1 parent 7b446d4 commit f473897
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/extensions/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@

plugin = arc.GatewayPlugin(name="Help Command Plugin")


def gather_commands(client: arc.GatewayClient):
command_list = []
for command in itertools.chain(client.walk_commands(hikari.CommandType.SLASH)):
command_list.append({
"name": command.name,
"description": command.description or "No description provided."
})
command_list.append(
{
"name": command.name,
"description": command.description or "No description provided.",
}
)
return command_list


@plugin.include
@arc.slash_command("help", "Displays a list of all commands.")
async def help_command(ctx: arc.GatewayContext) -> None:
Expand All @@ -22,10 +26,13 @@ async def help_command(ctx: arc.GatewayContext) -> None:
embed = hikari.Embed(title="Bot Commands", color=0x00FF00)

for command in commands:
embed.add_field(name=f"/{command['name']}", value=command['description'], inline=False)
embed.add_field(
name=f"/{command['name']}", value=command["description"], inline=False
)

await ctx.respond(embed=embed)


@arc.loader
def load(client: arc.GatewayClient) -> None:
client.add_plugin(plugin)

0 comments on commit f473897

Please sign in to comment.