📜  discord.js 验证 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:07.749000             🧑  作者: Mango

代码示例1
client.on('messageReactionAdd', async (reactionReaction, user) => {
   
   const message = reactionReaction.message;
   const verifyChannel = message.guild.channels.cache.find(c => c.name === 'approvazione');
   const member = message.guild.members.cache.get(user.id);
   if (member.user.bot) return;
   const verify = message.guild.roles.cache.get('728000975046180988');
   

   if (reactionReaction.emoji.name === '✅' && message.channel.id === verifyChannel.id) {
    member.roles.add(verify).catch(console.error);
   await reactionReaction.remove(member).catch(console.error);
    
}