From 43b6959805fb4e42866668b514e92b91f763d650 Mon Sep 17 00:00:00 2001 From: Intexisty Date: Thu, 13 Aug 2020 13:42:28 -0500 Subject: [PATCH] added more documentation updated documentation in emoji.nim, image.nim, message.nim, and role.nim --- src/nimcord/emoji.nim | 16 ++++++++-------- src/nimcord/image.nim | 6 +++--- src/nimcord/message.nim | 38 +++++++++++++++++++------------------- src/nimcord/role.nim | 16 ++++++++-------- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/nimcord/emoji.nim b/src/nimcord/emoji.nim index 67491e6..19d060a 100644 --- a/src/nimcord/emoji.nim +++ b/src/nimcord/emoji.nim @@ -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. diff --git a/src/nimcord/image.nim b/src/nimcord/image.nim index 2f30eae..588d626 100644 --- a/src/nimcord/image.nim +++ b/src/nimcord/image.nim @@ -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, diff --git a/src/nimcord/message.nim b/src/nimcord/message.nim index 921aed1..8643231 100644 --- a/src/nimcord/message.nim +++ b/src/nimcord/message.nim @@ -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 diff --git a/src/nimcord/role.nim b/src/nimcord/role.nim index abdbc90..75d6cf2 100644 --- a/src/nimcord/role.nim +++ b/src/nimcord/role.nim @@ -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.