discord-jda / JDA

Java wrapper for the popular chat & VOIP service: Discord https://discord.com
Apache License 2.0
4.28k stars 737 forks source link

Add Member#hasRoles(Role...) #2622

Closed AlexCai2019 closed 6 months ago

AlexCai2019 commented 6 months ago

Pull Request Etiquette

Changes

Closes Issue: NaN

Description

Add hasRoles(Role...) to Member.java and MemberImpl.java hasRole(Role...) returns true if the member has all these roles.

Role adminRole = guild.getRoleById(ADMIN_ROLE_ID);
if (member.hasRoles(adminRole))
    event.reply("This member is an admin!").queue();
kazuryyx commented 6 months ago

what in the actual ...

MinnDevelopment commented 6 months ago

Thank you, but we don't believe this provides much value over just using list operations.