javascript - Discord.js:[对象对象]
问题描述
我的代码是:
await button.clicker.fetch();
if (!button.clicker.member.roles.cache.has("859507507596230736")) return button.reply.send("Only staff can close the ticket.", true)
var embed = new Discord.MessageEmbed()
.setTitle("Are you sure?")
.setDescription("Are you sure you want to close this ticket?\nThis action cannot be undone.")
.setFooter(button.guild.name)
.setColor("RED")
var bu1tton = new MessageButton()
.setStyle(`red`)
.setEmoji(``)
.setLabel(`Proceed anyway`)
.setID("sure")
button.reply.send({ component: bu1tton, embed: embed }, true)
}
在我改成它之后button.reply.send({ component: bu1tton, embed: embed }, true)
,button.channel.send({ component: bu1tton, embed: embed })
它工作得很好,虽然每个人都可以看到。
我明白问题是, true
,但我不明白为什么?提前致谢。
解决方案
你必须使用ephemeral: true
而不是}, true)
这是代码:
button.reply.send({ component: bu1tton, embed: embed, ephemeral: true})