Add Channel.editChannelPermissions

This commit is contained in:
SeanOMik 2020-06-18 18:10:32 -05:00
parent 0c16ecada5
commit bc650bb867
No known key found for this signature in database
GPG Key ID: FA4D55AC05268A88
1 changed files with 6 additions and 2 deletions

View File

@ -273,8 +273,12 @@ proc bulkDeleteMessages*(channel: Channel, messages: seq[Message]) {.async.} =
waitFor channel.bulkDeleteMessages(messageIDs) waitFor channel.bulkDeleteMessages(messageIDs)
proc editChannelPermissions*(channel: Channel, perms: Permissions) {.async.} =
#TODO: https://discord.com/developers/docs/resources/channel#edit-channel-permissions ## 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] = proc getChannelInvites*(channel: Channel): seq[Invite] =
## Returns a list of invite objects (with invite metadata) for the channel. ## Returns a list of invite objects (with invite metadata) for the channel.