Create guild.getGuildMemberRoles

This commit is contained in:
SeanOMik 2020-06-19 16:15:55 -05:00
parent 4d135a73c7
commit 97e785de9b
No known key found for this signature in database
GPG Key ID: FA4D55AC05268A88
1 changed files with 7 additions and 1 deletions

View File

@ -855,3 +855,9 @@ proc createEmoji*(guild: Guild, name: string, image: Image, roles: seq[snowflake
return newEmoji(sendRequest(endpoint(fmt("/guilds/{guild.id}/emojis")), HttpPost, return newEmoji(sendRequest(endpoint(fmt("/guilds/{guild.id}/emojis")), HttpPost,
defaultHeaders(newHttpHeaders({"Content-Type": "application/json"})), defaultHeaders(newHttpHeaders({"Content-Type": "application/json"})),
guild.id, RateLimitBucketType.guild, jsonBody), guild.id) guild.id, RateLimitBucketType.guild, jsonBody), guild.id)
proc getGuildMemberRoles*(guild: Guild, member: GuildMember): seq[Role] =
## Get the role objects for a member's roles.
for role in guild.roles:
if (member.roles.contains(role.id)):
result.add(role)