Find out if someone has a role

前端 未结 6 1868
萌比男神i
萌比男神i 2020-12-06 11:47

I made a simple quote bot for a server, but the admin only wants mod+ people to be able to add quotes to avoid spam. I went to the documentation and did everything, but I ca

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-06 12:22

    This worked for me with version 12.2.0

    if(message.member.roles.cache.find(r => r.name === "Admin")) {
        // Your code
    }
    

    You can also use r.id to check with the role id

提交回复
热议问题