簡體   English   中英

有反應的 Dm 用戶

[英]Dm user who reacts

我的朋友想讓我為他的服務器制作一個機器人,他想建立一個驗證系統,當有人點擊反應時,機器人會向反應 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')
    }
 })

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM