added more documentation

updated documentation in emoji.nim, image.nim, message.nim, and role.nim
This commit is contained in:
Intexisty 2020-08-13 13:42:28 -05:00
parent befff9d294
commit 43b6959805
No known key found for this signature in database
GPG Key ID: 0F63AD8E987C9A17
4 changed files with 38 additions and 38 deletions

View File

@ -2,14 +2,14 @@ import json, discordobject, nimcordutils, user, httpcore, strutils, uri, strform
type type
Emoji* = ref object of DiscordObject Emoji* = ref object of DiscordObject
name*: string name*: string ## The name of the current emoji
roles*: seq[Snowflake] roles*: seq[Snowflake] ## Roles allowed to use the current emoji
user*: User user*: User ## The user who created the current em,oji
requireColons*: bool requireColons*: bool ## Whether or not the emoji requires colons :
managed*: bool managed*: bool ## Whether or not the emoji is managed
animated*: bool animated*: bool ## Whether or not the emoji is animated
available*: bool available*: bool
guildID*: Snowflake guildID*: Snowflake ## The guild this emoji belongs to
proc newEmoji*(json: JsonNode, guild: Snowflake): Emoji = proc newEmoji*(json: JsonNode, guild: Snowflake): Emoji =
## Construct an emoji with json. ## Construct an emoji with json.

View File

@ -1,9 +1,9 @@
import base64, streams, os, strformat import base64, streams, os, strformat
type Image* = ref object type Image* = ref object
filepath*: string filepath*: string ## The filepath of the current image
extension: string extension: string ## The extension of the current image
base64Encoded: string base64Encoded: string
proc newImage*(filepath: string): Image = proc newImage*(filepath: string): Image =
## Reads from a file that exists at `filepath`. It reads the image data, ## Reads from a file that exists at `filepath`. It reads the image data,

View File

@ -68,25 +68,25 @@ type
width*: int width*: int
Message* = ref object of DiscordObject Message* = ref object of DiscordObject
channelID*: Snowflake channelID*: Snowflake ## The channel the current message was sent in
guildID*: Snowflake guildID*: Snowflake ## The guild? the current message was sent in
author*: User author*: User ## The author of the current message
member*: GuildMember member*: GuildMember ## The guild member of the current message
content*: string content*: string ## The content of the current message
timestamp*: string timestamp*: string ## The timestamp of the current message
editedTimestamp*: string editedTimestamp*: string ## The edit timestamp of the current message (if there is one)
tts*: bool tts*: bool ## Whether or not the current message is Text To Speech enabled
mentionEveryone*: bool mentionEveryone*: bool ## Whether or not the current message mentions everyone
mentions*: seq[User] mentions*: seq[User] ## A list of the mentions in the current message
mentionRoles*: seq[Snowflake] mentionRoles*: seq[Snowflake] ## A list of role mentions in the current message
mentionChannels*: seq[ChannelMention] mentionChannels*: seq[ChannelMention] ## A list of channel mentions in the current message
attachments*: seq[MessageAttachment] attachments*: seq[MessageAttachment] ## A list of attachments in the current message
embeds*: seq[Embed] embeds*: seq[Embed] ## A list of embeds in the current message
reactions*: seq[Reaction] reactions*: seq[Reaction] ## A list of reactions in the current message
pinned*: bool pinned*: bool ## Whether or not this message is pinned
webhookID*: Snowflake webhookID*: Snowflake ## The id of the webhook? that sent the current message
`type`*: MessageType `type`*: MessageType ## The type of message
activity*: MessageActivity activity*: MessageActivity
application*: MessageApplication application*: MessageApplication
messageReference*: MessageReference messageReference*: MessageReference
flags*: int flags*: int

View File

@ -1,14 +1,14 @@
import json, nimcordutils, discordobject, permission, options, httpcore, asyncdispatch, strformat import json, nimcordutils, discordobject, permission, options, httpcore, asyncdispatch, strformat
type Role* = ref object of DiscordObject type Role* = ref object of DiscordObject
name*: string name*: string ## The name of the current role
color*: uint color*: uint ## the color of the current role
hoist*: bool hoist*: bool ## Whether or not the role is hoisted
position*: uint position*: uint ## The position of the current role
permissions*: Permissions permissions*: Permissions ## The permissions of the current role
managed*: bool managed*: bool
mentionable*: bool mentionable*: bool ## Whether or not the current role is mentionable
guildID*: Snowflake guildID*: Snowflake ## The guild id of the current role
proc newRole*(json: JsonNode, guild: Snowflake): Role = proc newRole*(json: JsonNode, guild: Snowflake): Role =
## Parses role from json. ## Parses role from json.