question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Are 'select menu's supported with modals?

See original GitHub issue

I’m trying to display a select menu as a response to a slash command. But getting an exception that says “only text input components are allowed.”. Is this expected? The data structures are there, so the exception got me confused a bit.

Here is a snippet:

await command.RespondWithModalAsync(
        new ModalBuilder("Bot Settings", "settings",
        new ModalComponentBuilder()
            {
                ActionRows = new List<ActionRowBuilder>()
                {
                    new ActionRowBuilder()
                        .WithSelectMenu( new SelectMenuBuilder()
                            .WithCustomId("alerts")
                            .WithOptions(new List<SelectMenuOptionBuilder>()
                            {
                                new SelectMenuOptionBuilder("Minimal","minimal","Minimum alert level."),
                                new SelectMenuOptionBuilder("Balanced","balanced","Balanced alert level."),
                                new SelectMenuOptionBuilder("Verbose","verbose","Verbose alert level."),
                            }))
                            ,
                }
            })
            .AddTextInput("Time format", "time_format")
            .Build());

Exception is thrown here: https://github.com/discord-net/Discord.Net/blob/dev/src/Discord.Net.Core/Entities/Interactions/Modals/ModalBuilder.cs#L124-L125

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
MrCakeSlayercommented, Sep 3, 2022

Just leaving this as a note, we have some users who already wrote support for them in modals for DNet, we are simply waiting on Discord to actually release the feature before merging.

0reactions
essoperagmacommented, Sep 3, 2022

Ah, that’s unfortunate. Thanks for clarifying!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Discord Modal with SelectMenu
1 Answer 1 ... Only text inputs are supported on modals. documentation · Share. Share a link to this answer.
Read more >
Discord.net Select Menu not visible in Modal : r/discordbots
Discord does not support select menus in modals yet. https://discord.com/developers/docs/interactions/receiving-and-responding#interaction- ...
Read more >
We cant received select menus from modal · Issue #8035
Select menus in modals are not yet supported. Discord.js will add full support, once discord considers the feature stable and documented (linked ...
Read more >
Modals | discord.js Guide
With modals you can create pop-up forms that allow users to ... We'll cover how to create, show, and receive modal forms using...
Read more >
Select Menus - Pycord Guide
Select Menus aren't the only message component in Discord. There's also Buttons and Modal Dialogs. Select Menus make it easy for users to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found