D
D
dyrtage2021-09-13 17:25:54
Python
dyrtage, 2021-09-13 17:25:54

How to handle button click in Dropdown Menus discord.py?

I am making a bot and added Dropdown Menus to its control menu (or select menu, to be honest, I don’t know the difference). Here is the code -

@bot.command()
async def menu(ctx):  # setting up the bot menu
    message_menu = discord.Embed(
        color = 0xFF00FF,
        title = "Меню бота ***",
        description = "Каждая команда находится в своем разделе.",
    )
    
    await ctx.send(embed = message_menu, components=
        [Select(placeholder = "Я жду твоего решения!", 
            options = [
                SelectOption( label = "Настройки сервера", value = "settings", emoji = "⚙️" ),
                SelectOption( label = "Модерация сервера", value = "moderator", emoji = "‍⚖️" ),
            ])], delete_after = 90)


How to handle clicking on the "Server Settings" button, for example, and some text appeared.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question