Add deleteChannelPermission

This commit is contained in:
SeanOMik 2020-06-21 15:13:58 -05:00
parent 1b4fcaaa79
commit a38e361d54
No known key found for this signature in database
GPG Key ID: FA4D55AC05268A88
1 changed files with 6 additions and 1 deletions

View File

@ -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 type
ChannelType* = enum ChannelType* = enum
@ -363,6 +363,11 @@ proc createChannelInvite*(channel: Channel, fields: CreateInviteFields): Invite
RateLimitBucketType.channel, createPayload)) RateLimitBucketType.channel, createPayload))
#TODO: https://discord.com/developers/docs/resources/channel#delete-channel-permission #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.} = proc triggerTypingIndicator*(channel: Channel) {.async.} =
## Post a typing indicator for the specified channel. ## Post a typing indicator for the specified channel.