有反应的DM用户

时间:2020-11-08 01:11:29

标签: javascript node.js discord.js

我的朋友要我为他的服务器制作一个机器人,他希望建立一个验证系统,当有人单击该响应时,该机器人会将响应给dm的人发送给

有人可以告诉我如何不用汤匙喂食吗

我的编码技能糟透了,但这是我尝试过的

client.on('message', async message => {
    if(message.content === "efyhidgyufagyhiftgahyifha") { // I did efyhidgyufagyhiftgahyifha because its not a public command
        const verifyembed = new Discord.MessageEmbed()
        .setDescription('Click The Fire Emoji And Fill Out The Forms To Get Access To The Server')
        (await message.channel.send(verifyembed)).react('?')
        const userreaction = message.member.guild.reactions
        if(!userreaction) 
        userreaction.send('Blah Blah Blah')
    }
 })

1 个答案:

答案 0 :(得分:0)

reactions不是Guild类的属性。您应该为message创建一个变量,对其进行反应,然后在其上调用awaitReactions()方法。

const msg = await message.channel.send('...');
await msg.react('...');
msg.awaitReactions((reaction, user) => /* your filter */, {
 max: 1,
 // any other 
 // collector settings
}).then((collected) => {
 // `collected` is a collection of MessageReactions - 
 // https://discord.js.org/#/docs/main/stable/class/MessageReaction

 // code...
});