不一致。JS向消息添加按钮 [英] Discord.JS Add a button to a message

查看:12
本文介绍了不一致。JS向消息添加按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想向现有消息添加另一个按钮(由机器人发送) 我已尝试:

// 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] })

当我编辑组件时,它会用新组件替换第一个组件。

如何向邮件添加新按钮?

推荐答案

不要编辑整个邮件。只需执行message.edit({components: [row]})

它应该只添加按钮而不编辑消息

这篇关于不一致。JS向消息添加按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆