我的反应角色命令在Discord.js v12中不起作用

时间:2020-09-30 12:32:18

标签: discord discord.js

好吧...我一直在尝试做出反应角色命令,但是它不起作用。该角色未授予用户。它给我这个错误“ ReferenceError:未定义反应”

代码:

const client = new Discord.Client({ partials: ["MESSAGE", "CHANNEL","REACTION"]});

client.on('message', async message => {
    if(message.content === '>reactions'){
        const embed = new Discord.MessageEmbed()
        .setTitle('Reaction Roles')
        .setDescription('React to obtain your roles!')
        .setColor('#242323')
        let MessageEmbed = await message.channel.send(embed)
        MessageEmbed.react('?‍?')
    }
    if(reaction.message.partial) await reaction.message.fetch();
    if(reaction.partial) await reaction.fetch();

    if(user.client) return;
    if(!reaction.message.guild) return;

    if(reaction.message.channel.id === "759064796611215442") {
        if(reaction.emoji.name === '?‍?'){
            await reaction.message.guild.member.cache.get(user.id).roles.add('760838222057046046')
        }
    }
});

0 个答案:

没有答案