#Slash Command redirect

22 messages · Page 1 of 1 (latest)

crimson lion
#

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?

limber compassBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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!
crimson lion
#

Node 18, discord.js: 13.9.2

opaque pendant
#

the only way is to show them a url or button

crimson lion
#

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?

glad prawn
#

You could probably create a blank text message by doing something like:

_ _

and then attach a button to the end of it

#

When you do _ _ it creates a blank message

#

Example:

#

_ _

#

^ as you can see a blank message

crimson lion
#

Might not be a terrible idea

glad prawn
#

At least that will allow you to have a blank message with a button

#

The other thing you could do is create a transparent image and upload it as a Emoji and use that however, emojis show up bigger as a blank message then the method I just described.

crimson lion
#

Tbf I may just go all in and make an embed for it, it's not a biggie. Thanks!

glad prawn
#

No problembo!

opaque pendant
#

you could also use masked links

crimson lion
#

Oh I forgot about those

austere bear
#

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

crimson lion
#

Oh sweet, so I can just have buttons then

#

Swwwwweeeeeeeeeeeeeeeet

#

Thanks