From a38e361d54b9db039ae7e591a60631dd915fa367 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Sun, 21 Jun 2020 15:13:58 -0500 Subject: [PATCH] Add deleteChannelPermission --- src/channel.nim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/channel.nim b/src/channel.nim index b0f2007..c89623e 100644 --- a/src/channel.nim +++ b/src/channel.nim @@ -1,4 +1,4 @@ -import json, discordobject, user, options, nimcordutils, message, httpcore, asyncdispatch, asyncfutures, permission, embed, httpclient, streams +import json, discordobject, user, options, nimcordutils, message, httpcore, asyncdispatch, asyncfutures, permission, embed, httpclient, streams, strformat type ChannelType* = enum @@ -363,6 +363,11 @@ proc createChannelInvite*(channel: Channel, fields: CreateInviteFields): Invite RateLimitBucketType.channel, createPayload)) #TODO: https://discord.com/developers/docs/resources/channel#delete-channel-permission +proc deleteChannelPermission*(channel: Channel, overwrite: Permissions) {.async.} = + ## Delete a channel permission overwrite for a user or role in a channel. + ## Only usable for guild channels. Requires the `MANAGE_ROLES` permission. + discard sendRequest(endpoint(fmt("/channels/{channel.id}/permissions/{overwrite.roleUserID}")), + HttpDelete, defaultHeaders(), channel.id, RateLimitBucketType.channel) proc triggerTypingIndicator*(channel: Channel) {.async.} = ## Post a typing indicator for the specified channel.