#Flap's too many buttons

1 messages · Page 1 of 1 (latest)

strong jewel
#

If I only do a channel.send, the embed, I get an "The application did not respond" message.

Ideally I'd want the embed to send without the reply note above it

Current code

        await interaction.reply({ content: 'Sending role selection embed...', ephemeral: true });
        await interaction.channel.send({ embeds: [rolePickerEmbed], components: [btnRow1, btnRow2, btnRow3] });
    }```
crisp orbit
#

that's where the already responded error is originating

strong jewel
#

await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });

crisp orbit
#

basically whats happening here is:

-> your bot receives an interaction
<- you send the "Sending role selection embed..."
<- you try to send the button menu stuff
(it errors)
<- you send the error message

but then it fails again because you already replied
you can use .followUp or .editReply instead of .reply on the error message

#

as for the first error with regarding the message components, can you show how you're defining them?

strong jewel
#

Switching the error to .followUp did the trick

#

We have 3 rows!

crisp orbit
#

oh, there we go!
did the followUp fix everything?

strong jewel
#

Yup

#

Now to continue reading documentation to learn how to hook up the functionality lul

crisp orbit
# strong jewel Now to continue reading documentation to learn how to hook up the functionality ...

suggestion:
whenever I'm creating such role react/button menus, I set the customId to something like role;<role id here>
then in an interactionCreate I split the customId at the ;, check if the first section is role and then just add/remove the roleid in the second section

i think that allows for easy customizability and you can reuse the same code for multiple servers, just changing the roleId placeholder for the button