• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

210
Views
Discord.JS Add a button to a message without replacing the previous one

I want to add another button to an existing message (send by the bot) I tried:

// const... log in... ....
let msg = await interaction.channel.fetchMessage(interaction.options.get('message-id'))
if(!msg || msg?.author?.id !== client.user.id) return interaction.reply({ content: "Error..." })

msg.edit({ embeds: ["a defined embed"], components: [row] })

When I edit the components, it replaces the first one with the new one.

How can I add a new button to the message?

over 3 years ago · Juan Pablo Isaza
1 answers
Answer question

0

msg.edit({ embeds: ["a defined embed"], components: [msg.components[0]], row] });
over 3 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 Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error