我正在尝试删除特定邮件中的所有回复。我正在尝试这样做:当用户对特定消息做出反应时,该漫游器会删除其反应。 这是我的代码:
Bot.on('raw', (event) => {
//Here the reactions will be removed
if (event.t == "MESSAGE_REACTION_ADD") {
if (event.d.emoji.name == "wither") {
var random = randomstring.generate({
length: 3,
charset: 'numeric'
});
for (let index = 0; index <= ids.length; index++) {
if (ids[index] == random) {
return;
} else {
adicionar = true;
}
}
if (adicionar = true) {
const guild = Bot.guilds.cache.get("532636265024323604");
guild.channels.create("Ticket—#" + random + "—").then (channel => {
channel.setTopic("**»** Tópico não especificado")
ids.push(random);
})
}
}
}
})