Slash Command redirect
Hi folks. Looking to create a slash command, that could allow the user to be redirected to an external url in their browser. The use case is signing up for an account on a website. I'd like to implement a /register command that would allow them to be redirected to my authentication service with some prepopulated values
What's the best way to do this? Return a button or url for them to click, or can a redirect/open browser be forced?
15 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!Node 18, discord.js: 13.9.2
the only way is to show them a url or button
Damn that's frustrating. I'm fairly sure I know the answer, but am I right in thinking buttons can only be attached to a text or embed reply?
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Might not be a terrible idea
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Tbf I may just go all in and make an embed for it, it's not a biggie. Thanks!
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
you could also use masked links
Oh I forgot about those
You can also just send a message with only components. Content and embeds aren't required if you have components as the components are enough to not be empty
When creating a message, apps must provide a value for at least one of content, embeds, sticker_ids, components, or files[n].https://discord.com/developers/docs/resources/channel#create-message-jsonform-params
Oh sweet, so I can just have buttons then
Swwwwweeeeeeeeeeeeeeeet
Thanks
i mean, would be problematic if discord could redirect people to any website...
It's a valid point, though they are capable of verification (as apparent with the torturous interactions endpoint verification)