Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

182
Visualizações
Discord.js Button Links

Hello I am trying to use a discord.js button to link to a website

This is what I attempted to do

const row = new MessageActionRow()
.addComponents(
new MessageButton()
    .setCustomId('whatever')
    .setLabel('CLICK THIS')
    .setLink("google.com")
    .setStyle('LINK'),
);

However this does not work due to set link not being a function

And the documentation doesnt help me out with this

about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

MessageButton.setLink() is not a function. Although I can see why this may be confusing because of the setStyle('LINK') being required. The correct function is .setURL(url). The MessageButton documentation is available here https://discord.js.org/#/docs/main/stable/class/MessageButton

about 4 years ago · Juan Pablo Isaza Relatório

0

Conor Reid is right

const row = new MessageActionRow()
.addComponents(
new MessageButton()
    .setLabel('CLICK THIS')
    .setURL("urlhere")
    .setStyle('LINK'),
);

The correct function is setUrl()

about 4 years ago · Juan Pablo Isaza Relatório

0

You need to use setURL instead of setLink

It is in the docs

let url 'https://google.com'
const row = new MessageActionRow()
.addComponents(
new MessageButton()
    .setLabel('Google')
    .setURL(url)
    .setStyle('LINK')
);
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda