help with buttons

is it possible for the bot to send another message after clicking a URL style button?
33 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
@flexyz
@flexyz2y ago
if you put message's url probably yes
keekztah
keekztahOP2y ago
so would i need to put the url instead of the customId since theyre the same
@flexyz
@flexyz2y ago
customId's for button click events if you want it to redirect to somewhere or to a message customId will not helpful for your situation
keekztah
keekztahOP2y ago
yea ik, after clicking a url button itll take me to the site, but im wondering if it can also edit the initial embed after clicking
@flexyz
@flexyz2y ago
i didnt used link buttons but i think it will work same as normal button interactions you can check interaction.type to button interaction and interaction.customId for button's id then change embed
keekztah
keekztahOP2y ago
okay thanks also, @flexyz. is it possible to make a command that sets a tag of a thread?
d.js docs
d.js docs2y ago
method ThreadChannel#setAppliedTags() Set the applied tags for this channel (only applicable to forum threads)
keekztah
keekztahOP2y ago
do i just do channel.setAppliedTags or is there a certain way of getting a thread type channel
It's Manny
It's Manny2y ago
If you don't mind me asking why do you want a url style button rather than secondary Oh sorry I didn't see you mention that
@flexyz
@flexyz2y ago
i didnt understand
keekztah
keekztahOP2y ago
huh?
@flexyz
@flexyz2y ago
if you want to set a tag for a thread channel just channel.setAppliedTags()
keekztah
keekztahOP2y ago
i want a link style so i can get sent to top gg website but i also want the embed to change into a new one after clicking the button then just the tag id?
@flexyz
@flexyz2y ago
its takes array of ids ['id'] 👍.
keekztah
keekztahOP2y ago
oh yea yea ty
It's Manny
It's Manny2y ago
So incase what @flexyz. Said doesn't work, the more complicated answer would be having it first link to your own website or server which sends a http request to your bot saying that the button's been pressed, and redirecting the user to top gg
keekztah
keekztahOP2y ago
oh man lol
@flexyz
@flexyz2y ago
i think link buttons interaction should be work
It's Manny
It's Manny2y ago
Yeah that would be the easiest if it does But I've never tried it before
mert
mert2y ago
When will someone reply to my post, sorry for asking it here
keekztah
keekztahOP2y ago
can u send me a link or example
@flexyz
@flexyz2y ago
in your interactioncreate event
if(interaction.isButton) {
if(interaction.customId === "/*Your button's id*/") {
//change embed
}
}
if(interaction.isButton) {
if(interaction.customId === "/*Your button's id*/") {
//change embed
}
}
treble/luna
treble/luna2y ago
Link buttons do not have a customid and will not trigger an interactionCreate event
@flexyz
@flexyz2y ago
really? damn
It's Manny
It's Manny2y ago
Yeah then ^ this would be the alternative
@flexyz
@flexyz2y ago
yeah
keekztah
keekztahOP2y ago
yea thats why, link button and custom id are the same
treble/luna
treble/luna2y ago
no they are not. Link buttons do not have a customid, just a url
keekztah
keekztahOP2y ago
yes im saying it is basically the same, as in you cant use both a link button and a customid button.
keekztah
keekztahOP2y ago
when i click the buttons, they do what theyre supposed to but it still shows interaction failed?
mert
mert2y ago
Are you comfortable with showing the code `?
keekztah
keekztahOP2y ago
what i coded the button to do was show commands from a certain folder. that works but i still get the interaction failed i figured it out thank you
Want results from more Discord servers?
Add your server