Answer the question
In order to leave comments, you need to log in
How should the list be formatted so that it displays the titles without the shackles and square brackets?
In general, my Discord bot has a help command that displays a list of help by command.
Piece of code:
async def send_bot_help(self, mapping):
embed = discord.Embed(title="Список моих доступных команд:", color=0x286EBA)
embed.set_thumbnail(url=client.user.avatar_url)
embed.set_footer(text=f"Powered by {client.user.display_name}",
icon_url=client.user.avatar_url)
for cog in mapping:
try:
embed.add_field(name=f"{cog.qualified_name} - {settings['PREFIX']}help {cog.qualified_name}", value=f"{[command.name for command in mapping[cog]]}", inline=False)
except AttributeError:
pass
await self.get_destination().send(embed=embed)
Answer the question
In order to leave comments, you need to log in
..., value=f"{','.join(map(lambda x:x.name,mapping[cog]))}", ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question