简体   繁体   中英

Dm user who reacts

My friend wanted me to make a bot for his server and he wants be to set up a verification system and it is when someone click the reaction the bot sends the person who reacts a dm

Can someone tell me how to do this without spoonfeeding

my coding skills suck btw but here is what i tried

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')
    }
 })

reactions is not a property of the Guild class. You should be creating a variable for the message , reacting to it, and then calling the awaitReactions() method on it.

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...
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM