Discord.js: [对象对象]
Discord.js: [ object Object ]
我一直在努力改进我的票务系统并遇到了这个问题:
我的代码是:
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})
我一直在努力改进我的票务系统并遇到了这个问题:
我的代码是:
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})