From 6d7897a10000e059fbcbf60a3a09b7bb54f6174e Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Thu, 18 Jun 2020 19:08:30 -0500 Subject: [PATCH] Add some documentation for types, remove ChannelType field in guild.nim --- src/guild.nim | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/guild.nim b/src/guild.nim index 358e1e7..a84e606 100644 --- a/src/guild.nim +++ b/src/guild.nim @@ -1,16 +1,8 @@ -import json, discordobject, channel, member, options, nimcordutils, emoji, role, permission +import json, discordobject, channel, member, options, nimcordutils, emoji, role, permission, httpcore type - ChannelType* = enum - chanTypeGuildText = 0, - chanTypeDM = 1, - chanTypeGuildVoice = 2, - chanTypeGroupDM = 3, - chanTypeGuildCategory = 4, - chanTypeGuildNews = 5, - chanTypeGuildStore = 6 - VerificationLevel* = enum + ## Verification level required for the guild. verifLevelNone = 0, verifLevelLow = 1, verifLevelMedium = 2, @@ -18,25 +10,30 @@ type verifLevelVeryHigh = 4 MFALevel* = enum + ## The required MFA level for the guild. mfaLevelNone = 0, mfaLevelElevated = 1 PremiumTier* = enum + ## Guild boost level premTierNone = 0, prermTierOne = 1, premTierTwo = 2, premTierThree = 3 MessageNotificationsLevel* = enum + ## Default message notifications level msgNotifLevelAll = 0, msgNotifLevelMentions = 1 ExplicitContentFilterLevel * = enum + ## Guild explicit content filter level expFilterLvlDisabled = 0, expFilterLvlMembersWithoutRoles = 1, expFilterLvlAllMembers = 2 Guild* = ref object of DiscordObject + ## Discord Guild object name*: string icon*: string splash*: string @@ -82,7 +79,7 @@ type approximatePresenceCount*: int proc newGuild*(json: JsonNode): Guild {.inline.} = - # Parsing all null or guaranteed fields + ## Parses a Guild type from json. var g = Guild( id: getIDFromJson(json["id"].getStr()), name: json["name"].getStr(),