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 toolkit12mo 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
@flexyz12mo ago
if you put message's url probably yes
keekztah
keekztah12mo ago
so would i need to put the url instead of the customId since theyre the same
@flexyz
@flexyz12mo 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
keekztah12mo 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
@flexyz12mo 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
keekztah12mo ago
okay thanks also, @flexyz. is it possible to make a command that sets a tag of a thread?
d.js docs
d.js docs12mo ago
method ThreadChannel#setAppliedTags() Set the applied tags for this channel (only applicable to forum threads)
keekztah
keekztah12mo ago
do i just do channel.setAppliedTags or is there a certain way of getting a thread type channel
It's Manny
It's Manny12mo 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
@flexyz12mo ago
i didnt understand
keekztah
keekztah12mo ago
huh?
@flexyz
@flexyz12mo ago
if you want to set a tag for a thread channel just channel.setAppliedTags()
keekztah
keekztah12mo 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
@flexyz12mo ago
its takes array of ids ['id'] 👍.
keekztah
keekztah12mo ago
oh yea yea ty
It's Manny
It's Manny12mo 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
keekztah12mo ago
oh man lol
@flexyz
@flexyz12mo ago
i think link buttons interaction should be work
It's Manny
It's Manny12mo ago
Yeah that would be the easiest if it does But I've never tried it before
pierce
pierce12mo ago
When will someone reply to my post, sorry for asking it here
keekztah
keekztah12mo ago
can u send me a link or example
@flexyz
@flexyz12mo 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/luna12mo ago
Link buttons do not have a customid and will not trigger an interactionCreate event
@flexyz
@flexyz12mo ago
really? damn
It's Manny
It's Manny12mo ago
Yeah then ^ this would be the alternative
@flexyz
@flexyz12mo ago
yeah
keekztah
keekztah12mo ago
yea thats why, link button and custom id are the same
treble/luna
treble/luna12mo ago
no they are not. Link buttons do not have a customid, just a url
keekztah
keekztah12mo ago
yes im saying it is basically the same, as in you cant use both a link button and a customid button.
keekztah
keekztah12mo ago
when i click the buttons, they do what theyre supposed to but it still shows interaction failed?
pierce
pierce12mo ago
Are you comfortable with showing the code `?
keekztah
keekztah12mo 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