【发布时间】:2020-09-07 15:43:39
【问题描述】:
当用户对我的嵌入有西瓜表情符号做出反应时,我正试图移动他们。
当我使用user.id 时,我可以获得他们的用户ID,但它不适用于
user.id.voice.setChannel("712142435794550894");
我得到的错误是:
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'setChannel' of undefined
这是我正在使用的代码:
const check = new MessageEmbed()
.setTitle("AFK CHECK")
.setColor(0xFF0000)
.setDescription("React with a `watermelon ????` PLS");
message.channel.send(check).then(sentEmbed => {
sentEmbed.react("????");
})
bot.on('messageReactionAdd', async(reaction, user) => {
let msg = reaction.message,
emoji = reaction.emoji;
const person = user.id;
if (emoji.name == '????' && user.id != "711388151960043582") {
message.channel.send("HI")
user.id.voice.setChannel("712142435794550894");
}
});
如何根据 id 移动用户?
【问题讨论】:
标签: javascript node.js bots discord.js