mirror of
https://github.com/RafaelSolVargas/Vulkan.git
synced 2025-10-29 16:57:23 +00:00
Relocating help command to Control class
This commit is contained in:
@@ -9,6 +9,11 @@ class Control(commands.Cog):
|
|||||||
|
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.__bot = bot
|
self.__bot = bot
|
||||||
|
self.__comandos = {
|
||||||
|
'MUSIC': ['this', 'resume', 'pause', 'loop', 'stop', 'skip', 'play', 'queue', 'clear'],
|
||||||
|
'RANDOM': ['cetus', ' frase'],
|
||||||
|
'HELP': ['help']
|
||||||
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def bot(self):
|
def bot(self):
|
||||||
@@ -33,6 +38,35 @@ class Control(commands.Cog):
|
|||||||
else:
|
else:
|
||||||
raise error
|
raise error
|
||||||
|
|
||||||
|
@commands.command(name="help", alisases=['ajuda'], help="Comando de ajuda")
|
||||||
|
async def help(self, ctx):
|
||||||
|
helptxt = ''
|
||||||
|
help_music = '-- MUSIC\n'
|
||||||
|
help_random = '-- RANDOM\n'
|
||||||
|
help_help = '-- HELP\n'
|
||||||
|
|
||||||
|
for command in self.__bot.commands:
|
||||||
|
if command.name in self.__comandos['MUSIC']:
|
||||||
|
help_music += f'**{command}** - {command.help}\n'
|
||||||
|
elif command.name in self.__comandos['HELP']:
|
||||||
|
help_help += f'**{command}** - {command.help}\n'
|
||||||
|
else:
|
||||||
|
help_random += f'**{command}** - {command.help}\n'
|
||||||
|
helptxt = f'{help_music}\n{help_random}\n{help_help}'
|
||||||
|
|
||||||
|
embedhelp = discord.Embed(
|
||||||
|
colour=config.COLOURS['grey'],
|
||||||
|
title=f'Comandos do {self.__bot.user.name}',
|
||||||
|
description=helptxt
|
||||||
|
)
|
||||||
|
|
||||||
|
embedhelp.set_thumbnail(url=self.__bot.user.avatar_url)
|
||||||
|
await ctx.send(embed=embedhelp)
|
||||||
|
|
||||||
|
@commands.Cog.listener()
|
||||||
|
async def on_error(self, error):
|
||||||
|
print('On Error')
|
||||||
|
|
||||||
|
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
bot.add_cog(Control(bot))
|
bot.add_cog(Control(bot))
|
||||||
|
|||||||
Reference in New Issue
Block a user