0

Im coding a discord bot in python and I have a help command, is there anyway to display the description in shorter terms? maybe split up the lines? right now it is long and hard to work with. Adding anything to the description is annoying.

@client.command()
async def help(ctx):
    em = discord.Embed(description='`prefix:` -\n***-***`info [ign] -` shows minecraft info\n***-***`status [ign] -` shows a players online status\n***-***`bw [ign] -` shows bedwars stats\n***-***`av [user] -` Gets users avatar\n***-***`shoot [user] -` bang bang\n***-***`hug [user] -` hugs :3\n***-***`kiss [user] -` mwah\n***-***`slap [user] - ` slap the shit out of someone\n***-***`help -` displays this message', color=0x8565c4)
    em.set_author(name=f'Help')
    await ctx.send(embed=em)
  • 1
    Have you taken a look at the built-in [help commands](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html?highlight=helpcommand#help-commands)? They may be a better alternative to what you're doing since it works mostly out of the box but also has quite a bit of customization. – metro Jan 17 '22 at 20:11
  • 2
    Does [this](https://stackoverflow.com/a/10660443/16177247) help? – TheFungusAmongUs Jan 17 '22 at 20:11

1 Answers1

0

So you can it look like this (you can create this with a loop) First you need to get all commands

bot_commands = bot.all_commands

Then create a loop, which creates the description.

description = ""
command_description = ["description_1",
                       "description_2"]        # write description here
for i in range(len(bot_commands)):
    description += f"**{bot_commands[i]}**\n{command_description[i]}"

I would recommend you to use a SQL database to select the description. You can easily create a database with sqlite3.

taktischer
  • 14
  • 3