Add some documentation for types, remove ChannelType field in guild.nim

This commit is contained in:
SeanOMik 2020-06-18 19:08:30 -05:00
parent a856900693
commit 6d7897a100
No known key found for this signature in database
GPG Key ID: FA4D55AC05268A88
1 changed files with 8 additions and 11 deletions

View File

@ -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 type
ChannelType* = enum
chanTypeGuildText = 0,
chanTypeDM = 1,
chanTypeGuildVoice = 2,
chanTypeGroupDM = 3,
chanTypeGuildCategory = 4,
chanTypeGuildNews = 5,
chanTypeGuildStore = 6
VerificationLevel* = enum VerificationLevel* = enum
## Verification level required for the guild.
verifLevelNone = 0, verifLevelNone = 0,
verifLevelLow = 1, verifLevelLow = 1,
verifLevelMedium = 2, verifLevelMedium = 2,
@ -18,25 +10,30 @@ type
verifLevelVeryHigh = 4 verifLevelVeryHigh = 4
MFALevel* = enum MFALevel* = enum
## The required MFA level for the guild.
mfaLevelNone = 0, mfaLevelNone = 0,
mfaLevelElevated = 1 mfaLevelElevated = 1
PremiumTier* = enum PremiumTier* = enum
## Guild boost level
premTierNone = 0, premTierNone = 0,
prermTierOne = 1, prermTierOne = 1,
premTierTwo = 2, premTierTwo = 2,
premTierThree = 3 premTierThree = 3
MessageNotificationsLevel* = enum MessageNotificationsLevel* = enum
## Default message notifications level
msgNotifLevelAll = 0, msgNotifLevelAll = 0,
msgNotifLevelMentions = 1 msgNotifLevelMentions = 1
ExplicitContentFilterLevel * = enum ExplicitContentFilterLevel * = enum
## Guild explicit content filter level
expFilterLvlDisabled = 0, expFilterLvlDisabled = 0,
expFilterLvlMembersWithoutRoles = 1, expFilterLvlMembersWithoutRoles = 1,
expFilterLvlAllMembers = 2 expFilterLvlAllMembers = 2
Guild* = ref object of DiscordObject Guild* = ref object of DiscordObject
## Discord Guild object
name*: string name*: string
icon*: string icon*: string
splash*: string splash*: string
@ -82,7 +79,7 @@ type
approximatePresenceCount*: int approximatePresenceCount*: int
proc newGuild*(json: JsonNode): Guild {.inline.} = proc newGuild*(json: JsonNode): Guild {.inline.} =
# Parsing all null or guaranteed fields ## Parses a Guild type from json.
var g = Guild( var g = Guild(
id: getIDFromJson(json["id"].getStr()), id: getIDFromJson(json["id"].getStr()),
name: json["name"].getStr(), name: json["name"].getStr(),