Skip to content

Commit c54c655

Browse files
authored
Create help command (#29)
1 parent 9f67371 commit c54c655

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

bot/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,7 @@ async def unload(ctx: discord.ext.commands.Context, extension: str):
5252
await ctx.send(f"O cog {extension} foi desativado.")
5353

5454

55+
# Load extensions
5556
client.load_extension("bot.cogs.belts")
5657
client.load_extension("bot.cogs.daily_report")
58+
client.load_extension("bot.cogs.help")

bot/cogs/help.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import discord
2+
from discord.ext import commands
3+
4+
5+
class Help(commands.Cog):
6+
def __init__(self, client: commands.Bot):
7+
self.client = client
8+
9+
@commands.command(name="help")
10+
async def help(self, ctx: discord.ext.commands.Context) -> None:
11+
12+
# Embed sent by the bot
13+
embed = discord.Embed(
14+
title="Comandos: [Obrigatório] <Opcional> (alias)", color=0x3489EB
15+
)
16+
17+
fields = [
18+
("$help", "É preciso apresentações?"),
19+
("$promove [ninja] [cinturão]", "Promove um ninja para o cinturão dado."),
20+
]
21+
22+
for name, value in fields:
23+
embed.add_field(name=name, value=value, inline=False)
24+
25+
await ctx.reply(embed=embed)
26+
27+
28+
def setup(client):
29+
client.add_cog(Help(client))

0 commit comments

Comments
 (0)