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
Emoji* = ref object of DiscordObject
name*: string
roles*: seq[Snowflake]
user*: User
requireColons*: bool
managed*: bool
animated*: bool
available*: bool
guildID*: Snowflake
name*: string ## The name of the current emoji
roles*: seq[Snowflake] ## Roles allowed to use the current emoji
user*: User ## The user who created the current em,oji
requireColons*: bool ## Whether or not the emoji requires colons :
managed*: bool ## Whether or not the emoji is managed
animated*: bool ## Whether or not the emoji is animated
available*: bool
guildID*: Snowflake ## The guild this emoji belongs to
proc newEmoji*(json: JsonNode, guild: Snowflake): Emoji =
## Construct an emoji with json.

View File

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

View File

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

View File

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