3

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?

Kodeur_Kubik
  • 140
  • 1
  • 11

1 Answers1

2
msg.edit({ embeds: ["a defined embed"], components: [msg.components[0]], row] });
Finbar
  • 1,127
  • 1
  • 5
  • 17