From bc650bb8675977802f834d20fa471eae3b2262e4 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Thu, 18 Jun 2020 18:10:32 -0500 Subject: [PATCH] Add Channel.editChannelPermissions --- src/channel.nim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/channel.nim b/src/channel.nim index 54f4910..2c46612 100644 --- a/src/channel.nim +++ b/src/channel.nim @@ -273,8 +273,12 @@ proc bulkDeleteMessages*(channel: Channel, messages: seq[Message]) {.async.} = waitFor channel.bulkDeleteMessages(messageIDs) - -#TODO: https://discord.com/developers/docs/resources/channel#edit-channel-permissions +proc editChannelPermissions*(channel: Channel, perms: Permissions) {.async.} = + ## Edit the channel permission overwrites for a user or role in a channel. + ## Only usable for guild channels. Requires the `MANAGE_ROLES` permission. + discard sendRequest(endpoint("/channels/" & $channel.id & "/permissions/" & $perms.roleUserID), + HttpPost, defaultHeaders(newHttpHeaders({"Content-Type": "application/json"})), channel.id, + RateLimitBucketType.channel, perms.permissionsToJson()) proc getChannelInvites*(channel: Channel): seq[Invite] = ## Returns a list of invite objects (with invite metadata) for the channel.