Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
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 answers
Answer question

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 Report

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!