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

236
Views
I can't figure out discord.js v13 buttons

I just can't figure out how to send a button interaction with a message in Discord.js v13 in v12 you just use discord-buttons but here it's built-in somehow and I can't quite get it.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Discord.js has a great documentation and you can find more about buttons in Buttons Section. It is well documented and there are some good examples too.

about 4 years ago · Juan Pablo Isaza Report

0

const { MessageActionRow, MessageButton } = require('discord.js');

client.on('interactionCreate', async interaction => {
    if (!interaction.isCommand()) return;

    if (interaction.commandName === 'ping') {
        const row = new MessageActionRow()
            .addComponents(
                new MessageButton()
                    .setCustomId('primary')
                    .setLabel('Primary')
                    .setStyle('PRIMARY'),
            );

        await interaction.reply({ content: 'Pong!', components: [row] });
    }
});

For external redirect button, you should use .setLabel('LINK') instead of .setLabel('Primary') then remove .setCustomId('primary'). Add .setURL('URL')

For more click here

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!