Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

173
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda