From 97e785de9bee2c71cbb474ae509a6965e1d45773 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Fri, 19 Jun 2020 16:15:55 -0500 Subject: [PATCH] Create guild.getGuildMemberRoles --- src/guild.nim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/guild.nim b/src/guild.nim index bcf188e..02ec480 100644 --- a/src/guild.nim +++ b/src/guild.nim @@ -854,4 +854,10 @@ proc createEmoji*(guild: Guild, name: string, image: Image, roles: seq[snowflake return newEmoji(sendRequest(endpoint(fmt("/guilds/{guild.id}/emojis")), HttpPost, defaultHeaders(newHttpHeaders({"Content-Type": "application/json"})), - guild.id, RateLimitBucketType.guild, jsonBody), guild.id) \ No newline at end of file + 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) \ No newline at end of file