【发布时间】:2021-08-28 20:41:36
【问题描述】:
几乎是标题所说的,但我只是想弄清楚如何让我的机器人向对其发送的消息做出反应的任何人和每个人发送 DM。
name: "sign-up",
description: "signup thing",
category: "misc",
execute(message, client){
const args = message.content.slice(prefix.length).trim().split(' ');
const command = args.shift().toLowerCase();
const say = args.join(" ");
if (!args.length) {
return message.channel.send(`You didn't provide any arguments, ${message.author}!`);
}
message.channel.send(say).then(message =>{
message.react("✅")
const filter = (reaction, user) => {
return ['✅'].includes(reaction.emoji.name) && user.id === message.author.id;
};
const collector = message.createReactionCollector(filter, {time: 60000 });
collector.on('collect', (reaction, reactionCollector) => {
reaction.users.last().send('Some')
.catch(console.error)
});
}
在这种情况下,管理员将编写一条消息(正确显示为 args),而我已经走到了这一步,我只想在我的控制台中返回反应用户。我几乎被困在这里了。
抱歉,如果代码很奇怪。
【问题讨论】:
标签: javascript discord discord.js