#Interaction not responding upon button click
31 messages · Page 1 of 1 (latest)
func (i Interaction) MessageComponentData() (data MessageComponentInteractionData)
```
MessageComponentData is helper function to assert the inner InteractionData to MessageComponentInteractionData. Make sure to check that the Type of the interaction is InteractionMessageComponent before calling.
Guess I still dont quite understand it..
There has to be a somewhat simpler way than what I have it code as at the moment..
do you understand why you're getting the ignore print that you're getting?
( @queen oxide )
I apologize for the delayed response and appreciate you responding.
Not really, is it because it’s always defaulting due to the interaction not being an app command or message component?
This is my first go at trying buttons.
Hoping to eventually incorporate select menu as well.
you're only handling application command interactions. buttons are not those.
like darp said, you get a message component interaction when a button is pressed.
I do understand that, I do have a setup with component handlers and command handlers (like the bwmarrin git examples/components.go) as well.
ok, but your switch only has a single case of type discordgo.InteractionApplicationCommand.
discordgo.InteractionApplicationCommand is not the type of interaction generated by a button press.
remember, slash/user/message commands are discordgo.InteractionApplicationCommands, buttons/selects are discordgo.InteractionMessageComponents, and modals are discordgo.InteractionModalSubmits
https://pkg.go.dev/github.com/bwmarrin/discordgo#InteractionType
please note that Buttons with link style never generate interaction
Received, I’ll dig more.
Thanks yall!
well that is not it 
??
Clicking the next button makes another next button appear.
code?
I have no idea where to begin on which code to send honestly...
I have played with this so much its crazy.
Actually... gonna be this code
"help_next": func(s *discordgo.Session, i *discordgo.InteractionCreate) {
err := s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
Type: discordgo.InteractionResponseChannelMessageWithSource,
Data: &discordgo.InteractionResponseData{
Components: []discordgo.MessageComponent{
discordgo.ActionsRow{
Components: []discordgo.MessageComponent{
discordgo.Button{
Emoji: discordgo.ComponentEmoji{
Name: "➡",
},
Label: "Next",
Style: discordgo.PrimaryButton,
CustomID: "help_next",
Disabled: page == totalPages()-1,
},
},
},
},
Flags: discordgo.MessageFlagsEphemeral,
},
})
if err != nil {
panic(err)
}
},
I just added the ephemeral flag after the screenshot
i mean…isn’t that what the code you pasted does?
do you not understand why what you posted produces another button? have you tried walking through what executes in your code (e.g. with prints or a debugger)?
on receiving an interaction with ID help_next, you’re sending a response with an action row with one component: a button that says next, and when clicked, sends an interaction with ID help_next.
that’s the code you wrote. do you agree?
it feels to me like you’re having some trouble understanding your own code, and it’s really hard for us to provide any meaningful help when that’s the case.