【发布时间】:2022-01-10 16:30:31
【问题描述】:
const filter = (interaction) => {
if (interaction.user.id === message.author.id) return true;
return interaction.reply({
content: "An error has occurred",
ephemeral: true
})
}
const collectorValue1 = message.channel.createMessageComponentCollector({
filter,
max: 1
})
collectorValue1.on("end", (ButtonInteraction) => {
const id = ButtonInteraction.first().customId;
if (id == '1') {
ButtonInteraction.first().reply({
content: "CONTENT",
ephemeral: true
})
} else if (id == '2') {
ButtonInteraction.first().reply({
content: "CONTENT",
ephemeral: true
})
} else if (id == '3') {
ButtonInteraction.first().reply({
content: "CONTENT.",
ephemeral: true
})
}
})
我希望在创建按钮时它们是多个可执行文件,但是我只能使用该按钮一次,之后我总是收到消息“此交互失败”。如何使按钮具有多个可执行性?
【问题讨论】:
标签: javascript discord discord.js