Add some more fields to some of the message proc's docs

This commit is contained in:
SeanOMik 2020-06-18 16:12:00 -05:00
parent e153ddea49
commit ba12b8ae03
No known key found for this signature in database
GPG Key ID: FA4D55AC05268A88
1 changed files with 33 additions and 6 deletions

View File

@ -24,17 +24,17 @@ type
listen = 3, listen = 3,
joinRequest = 5 joinRequest = 5
MessageActivity* = object MessageActivity* = ref object
`type`*: MessageActivityType `type`*: MessageActivityType
partyID*: string partyID*: string
MessageApplication* = object of DiscordObject MessageApplication* = ref object of DiscordObject
coverImage: string coverImage: string
description: string description: string
icon: string icon: string
name: string name: string
MessageReference* = object MessageReference* = ref object
messageID: snowflake messageID: snowflake
channelID: snowflake channelID: snowflake
guildID: snowflake guildID: snowflake
@ -130,13 +130,19 @@ proc addReaction*(message: Message, emoji: Emoji) {.async.} =
## permission to be present on the current user. ## permission to be present on the current user.
## ##
## See also: ## See also:
## * `removeReaction(message: Message, emoji: Emoji)`_ ## * `removeReaction<#removeReaction,Message,Emoji>`_
discard sendRequest(endpoint("/channels/" & $message.channelID & "/messages/" & $message.id & discard sendRequest(endpoint("/channels/" & $message.channelID & "/messages/" & $message.id &
"/reactions/" & emoji.toUrlEncoding() & "/@me"), HttpPut, defaultHeaders(), "/reactions/" & emoji.toUrlEncoding() & "/@me"), HttpPut, defaultHeaders(),
message.channelID, RateLimitBucketType.channel) message.channelID, RateLimitBucketType.channel)
proc removeReaction*(message: Message, emoji: Emoji) {.async.} = proc removeReaction*(message: Message, emoji: Emoji) {.async.} =
## Delete a reaction the bot user has made for the message. ## Delete a reaction the bot user has made for the message.
##
## See also:
## * `addReaction<#addReaction,Message,Emoji>`_
## * `removeUserReaction<#removeUserReaction,Message,Emoji,User>`_
## * `removeAllReactions<#removeAllReactions,Message>`_
## * `removeAllReactions<#removeAllReactions,Message,Emoji>`_
discard sendRequest(endpoint("/channels/" & $message.channelID & "/messages/" & $message.id & discard sendRequest(endpoint("/channels/" & $message.channelID & "/messages/" & $message.id &
"/reactions/" & emoji.toUrlEncoding() & "/@me"), HttpDelete, defaultHeaders(), "/reactions/" & emoji.toUrlEncoding() & "/@me"), HttpDelete, defaultHeaders(),
message.channelID, RateLimitBucketType.channel) message.channelID, RateLimitBucketType.channel)
@ -144,6 +150,12 @@ proc removeReaction*(message: Message, emoji: Emoji) {.async.} =
proc removeUserReaction*(message: Message, emoji: Emoji, user: User) {.async.} = proc removeUserReaction*(message: Message, emoji: Emoji, user: User) {.async.} =
## Deletes another user's reaction. This endpoint requires the ## Deletes another user's reaction. This endpoint requires the
## `MANAGE_MESSAGES` permission to be present on the current user ## `MANAGE_MESSAGES` permission to be present on the current user
##
## See also:
## * `addReaction<#addReaction,Message,Emoji>`_
## * `removeReaction<#removeReaction,Message,Emoji>`_
## * `removeAllReactions<#removeAllReactions,Message>`_
## * `removeAllReactions<#removeAllReactions,Message,Emoji>`_
discard sendRequest(endpoint("/channels/" & $message.channelID & "/messages/" & $message.id & discard sendRequest(endpoint("/channels/" & $message.channelID & "/messages/" & $message.id &
"/reactions/" & emoji.toUrlEncoding() & "/" & $user.id), HttpDelete, defaultHeaders(), "/reactions/" & emoji.toUrlEncoding() & "/" & $user.id), HttpDelete, defaultHeaders(),
message.channelID, RateLimitBucketType.channel) message.channelID, RateLimitBucketType.channel)
@ -185,16 +197,28 @@ proc getReactants*(message: Message, emoji: Emoji, request: ReactantsGetRequest)
for user in json: for user in json:
result.add(newUser(user)) result.add(newUser(user))
proc removeAllReactions*(message: Message) {.asnyc.} = proc removeAllReactions*(message: Message) {.async.} =
## Deletes all reactions on a message. This endpoint requires the ## Deletes all reactions on a message. This endpoint requires the
## `MANAGE_MESSAGES` permission to be present on the current user. ## `MANAGE_MESSAGES` permission to be present on the current user.
##
## See also:
## * `addReaction<#addReaction,Message,Emoji>`_
## * `removeReaction<#removeReaction,Message,Emoji>`_
## * `removeUserReaction<#removeUserReaction,Message,Emoji,User>`_
## * `removeAllReactions<#removeAllReactions,Message,Emoji>`_
discard sendRequest(endpoint("/channels/" & $message.channelID & "/messages/" & $message.id & discard sendRequest(endpoint("/channels/" & $message.channelID & "/messages/" & $message.id &
"/reactions/"), HttpDelete, defaultHeaders(), message.channelID, RateLimitBucketType.channel) "/reactions/"), HttpDelete, defaultHeaders(), message.channelID, RateLimitBucketType.channel)
proc removeAllReactions*(message: Message, emoji: Emoji) {.asnyc.} = proc removeAllReactions*(message: Message, emoji: Emoji) {.async.} =
## Deletes all the reactions for a given emoji on a message. This ## Deletes all the reactions for a given emoji on a message. This
## endpoint requires the `MANAGE_MESSAGES` permission to be present ## endpoint requires the `MANAGE_MESSAGES` permission to be present
## on the current user. ## on the current user.
##
## See also:
## * `addReaction<#addReaction,Message,Emoji>`_
## * `removeReaction<#removeReaction,Message,Emoji>`_
## * `removeUserReaction<#removeUserReaction,Message,Emoji,User>`_
## * `removeAllReactions<#removeAllReactions,Message>`_
discard sendRequest(endpoint("/channels/" & $message.channelID & "/messages/" & $message.id & discard sendRequest(endpoint("/channels/" & $message.channelID & "/messages/" & $message.id &
"/reactions/" & emoji.toUrlEncoding()), HttpDelete, defaultHeaders(), message.channelID, "/reactions/" & emoji.toUrlEncoding()), HttpDelete, defaultHeaders(), message.channelID,
RateLimitBucketType.channel) RateLimitBucketType.channel)
@ -211,5 +235,8 @@ proc deleteMessage*(message: Message) {.async.} =
## Delete a message. If operating on a guild channel and trying to delete ## Delete a message. If operating on a guild channel and trying to delete
## a message that was not sent by the current user, this endpoint requires ## a message that was not sent by the current user, this endpoint requires
## the `MANAGE_MESSAGES` permission. ## the `MANAGE_MESSAGES` permission.
##
## See also:
## * `deleteMessage<#deleteMessage,Message>`_
discard sendRequest(endpoint("/channels/" & $message.channelID & "/messages/" & $message.id), discard sendRequest(endpoint("/channels/" & $message.channelID & "/messages/" & $message.id),
HttpDelete, defaultHeaders(), message.channelID, RateLimitBucketType.channel) HttpDelete, defaultHeaders(), message.channelID, RateLimitBucketType.channel)