Get Number from Slash Command and put it on a link

Viewed 13

So, if a user says /GetProfile (EnterNumberHere)

The Number from that command should go at the end of a link

for example, i said /GetProfile 1 the number "1" should go at the end of this link "http://cubestoria.ezyro.com/User/?id="

So, then the bot will respond with http://cubestoria.ezyro.com/User/?id=1

https://i.stack.imgur.com/dYCU0.png I want to look like this but their is a option (like the diet in the photo) that you can put a number in.

1 Answers

Use ${variable} to put variable in string:

// ...
.addNumberOption(option => option.setName('diet').setDescription('...'))
const number = interaction.options.getNumber('diet')
interaction.reply(`http://cubestoria.ezyro.com/User/?id=${number}`)
Related