0
votes

Comment puis-je créer plusieurs commandes d'aide telles que l'aide , Aide etc.

Donc, j'ai une commande (code> et j'ai également fait une commande help_fun .

Qu'est-ce que j'essaie de faire est que lorsque la personne indique d-help , le bot doit afficher la sortie Aide la commande, mais lorsque la personne indique d-Aide Fun Il doit afficher la sortie de commande help_fun .

lorsque la personne indique d-help amusement Il affiche toujours l'aide au lieu de xxx


0 commentaires

3 Réponses :


0
votes

Supprimer le @ client.command () code> à partir de vos deux commandes d'aide et appelez-les comme des fonctions ASYNC normales lorsque vous détectez D-Aide code> ou D- Aidez amusant code> Mots-clés.
De cette façon, vous pouvez élargir indéfiniment vos commandes d'aide et avoir autant que vous le souhaitez

client.remove_command('help')
@client.event
async def on_message(message):
  if message.content.startswith("d-help fun"):
    await help_fun(message.channel)
  elif message.content.startswith("d-help"):
    await help(message.channel)


async def help(channel):
  embed = discord.Embed(
      title = '🔹 Thanks for using my bot',url="http://wq.lt/UwBrZ",
      description = "➺ This bot is currently in beta. More commands will be added soon.",
      colour = 0x0af78a
  )

  embed.set_author(name='Help',icon_url='https://cdn2.iconfinder.com/data/icons/app-types-in-grey/512/info_512pxGREY.png')
  embed.set_footer(text="Say d-help fun | admin | server | music, for the commands")
  embed.set_image(url='')
  embed.set_thumbnail(url='https://i.imgur.com/9Y04G7u.png')

  embed.add_field(name= "Music", value="4 Music commands", inline=True)
  embed.add_field(name= "Server", value="5 Server commands", inline=True)
  embed.add_field(name= "Admin", value="5 Admin commands", inline=True)
  embed.add_field(name= "Fun", value="20 Fun commands", inline=True)
  await client.send_message(channel,embed=embed)

async def help_fun(channel):
  embed = discord.Embed(
      title =None,#'🔹 Thanks for using my bot',url="http://wq.lt/UwBrZ",
      description = "➺ This bot is currently in beta. More commands will be added soon.",
      colour = 0x0af78a
  )

  embed.set_author(name='Fun commands',icon_url='https://i.imgur.com/9Y04G7u.png')
  embed.set_footer(text="Bot still in beta and more commands are being added")
  embed.set_image(url='')
  embed.add_field(name= "═─────────────────═", value='d-say <text>\nd-type <text>\nd-tts <text>\nd-timer <Number>\nd-embed <text>\nd-embed2 <text>\nembed3 <text>\nd-joke\nd-invite\nd-8ball\nd-flip <word>\nd-color <hex>\nd-ping\nd-dice\nd-fancytext <text>\nd-shorten <link>\nd-unshorten\nd-uni <:emoji:>\nd-define <word>\nd-chatters', inline=False)
  await client.send_message(channel,embed=embed)


0 commentaires

2
votes

Vous pouvez utiliser un < Code> Groupe pour organiser des commandes dans les sous-commandes xxx

alors vous pouvez appeler .help amusant , etc


0 commentaires

0
votes

J'ai ajouté un nom nom: str = Aucune qui vérifie une chaîne fournie avec le D-Aide , et s'il n'y a pas, il équivaut à un nom à Aucun , qui affiche l'aide d'origine d'origine page. Ici, vous pouvez ajouter un autre elif pour ajouter une page d'aide pour une nouvelle commande. XXX


0 commentaires