T
T
Tim Novikov2021-08-20 13:54:09
Python
Tim Novikov, 2021-08-20 13:54:09

How to make a sub-item in a discord.py message?

The bot sends the following message,
611f885c32401436476641.png
this is the !help command, here is its code

@bot.command(pass_context = True)
@commands.has_role("Admin")
async def help(ctx):
    emb = discord.Embed(title="Навигация по командам", colour=discord.Color.dark_blue())

    #emb.set_author(name="ok", icon_url="https://www.gambaranimasi.org/data/media/1272/animasi-bergerak-tanda-info-0002.gif")
    emb.set_thumbnail(url="https://www.gambaranimasi.org/data/media/1272/animasi-bergerak-tanda-info-0002.gif")
    #emb.set_image(url="https://d.radikal.ru/d18/1901/72/2c7e00128a9a.png")
    emb.add_field(name="{}сlear X".format(PREFIX),value="Очистка чата, X - количество удаляемых сообщений (не более 100)"   )
    emb.add_field(name = "{}say #channel text".format(PREFIX), value="Cказать что-то от имени бота в нужный канал.\
    (text - ваш текст).")
    emb.add_field(name="{}sayto @name #channel text".format(PREFIX), value="Тоже самое, что и say но перед\
    вашим сообщением добавляется упоминание пользователя.")
    emb.add_field(name="{}kick @name причина".format(PREFIX),\
    value="Исключение участника с сервера, Обязательно использовать с упоминанием @")
    emb.add_field(name="{}ban @name причина".format(PREFIX),\
    value="БАН участника на сервере, Обязательно использовать с упоминанием @")
    emb.add_field(name="{}unban @name".format(PREFIX),\
    value="РАЗБАН участника на сервере, Обязательно использовать с упоминанием @")
    await ctx.send(embed = emb)


The bottom line is that I want to make something like a drop-down message, that is, instead of the Heading-name of the command and the description of the command under it, the User saw only the list of commands, and already by clicking on the command-heading the description was opened.

For example, we need command 2, we call !help, a message comes from the bot

Command navigation
!command 1
!command 2
!command 3

Click command 2, and the bot DOES NOT send a new message, but just opens the description in the same.

Command navigation
!command 1
!command 2
here is the description of command 2, blah blah
!command 3

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2021-08-21
@Tim_1527

if you mean something like a drop-down list (like, say, on this site , if you click on "History"), then discord does not yet have such functionality.

A
Alan Gibizov, 2021-08-20
@phaggi

I think they're called "spoilers" and there's a discord tag for them .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question