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
d.js toolkit
d.js toolkit16mo ago
- 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!
Flinty
FlintyOP16mo ago
Node 18, discord.js: 13.9.2
treble/luna
treble/luna16mo ago
the only way is to show them a url or button
Flinty
FlintyOP16mo ago
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
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Flinty
FlintyOP16mo ago
Might not be a terrible idea
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Flinty
FlintyOP16mo ago
Tbf I may just go all in and make an embed for it, it's not a biggie. Thanks!
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
treble/luna
treble/luna16mo ago
you could also use masked links
Flinty
FlintyOP16mo ago
Oh I forgot about those
edocsil
edocsil16mo ago
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
Flinty
FlintyOP16mo ago
Oh sweet, so I can just have buttons then Swwwwweeeeeeeeeeeeeeeet Thanks
xHeg
xHeg16mo ago
i mean, would be problematic if discord could redirect people to any website...
Flinty
FlintyOP16mo ago
It's a valid point, though they are capable of verification (as apparent with the torturous interactions endpoint verification)
Want results from more Discord servers?
Add your server