Add VerificationLevel value consts and a typedef for int
This commit is contained in:
parent
226df093f6
commit
58fe658fa5
2 changed files with 36 additions and 25 deletions
|
@ -405,7 +405,7 @@ func (s *Session) GuildEdit(guildID string, g GuildParams) (st *Guild, err error
|
||||||
data := struct {
|
data := struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Region string `json:"region,omitempty"`
|
Region string `json:"region,omitempty"`
|
||||||
VerificationLevel *int `json:"verification_level,omitempty"`
|
VerificationLevel *VerificationLevel `json:"verification_level,omitempty"`
|
||||||
}{g.Name, g.Region, g.VerificationLevel}
|
}{g.Name, g.Region, g.VerificationLevel}
|
||||||
|
|
||||||
body, err := s.Request("PATCH", GUILD(guildID), data)
|
body, err := s.Request("PATCH", GUILD(guildID), data)
|
||||||
|
|
15
structs.go
15
structs.go
|
@ -145,6 +145,17 @@ type Emoji struct {
|
||||||
RequireColons bool `json:"require_colons"`
|
RequireColons bool `json:"require_colons"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Custom VerificationLevel typedef for int
|
||||||
|
type VerificationLevel int
|
||||||
|
|
||||||
|
// Constants for VerificationLevel levels from 0 to 3 inclusive
|
||||||
|
const (
|
||||||
|
VerificationLevelNone VerificationLevel = iota
|
||||||
|
VerificationLevelLow VerificationLevel = iota
|
||||||
|
VerificationLevelMedium VerificationLevel = iota
|
||||||
|
VerificationLevelHigh VerificationLevel = iota
|
||||||
|
)
|
||||||
|
|
||||||
// A Guild holds all data related to a specific Discord Guild. Guilds are also
|
// A Guild holds all data related to a specific Discord Guild. Guilds are also
|
||||||
// sometimes referred to as Servers in the Discord client.
|
// sometimes referred to as Servers in the Discord client.
|
||||||
type Guild struct {
|
type Guild struct {
|
||||||
|
@ -158,7 +169,7 @@ type Guild struct {
|
||||||
JoinedAt string `json:"joined_at"` // make this a timestamp
|
JoinedAt string `json:"joined_at"` // make this a timestamp
|
||||||
Splash string `json:"splash"`
|
Splash string `json:"splash"`
|
||||||
AfkTimeout int `json:"afk_timeout"`
|
AfkTimeout int `json:"afk_timeout"`
|
||||||
VerificationLevel int `json:"verification_level"`
|
VerificationLevel VerificationLevel `json:"verification_level"`
|
||||||
EmbedEnabled bool `json:"embed_enabled"`
|
EmbedEnabled bool `json:"embed_enabled"`
|
||||||
Large bool `json:"large"` // ??
|
Large bool `json:"large"` // ??
|
||||||
Roles []*Role `json:"roles"`
|
Roles []*Role `json:"roles"`
|
||||||
|
@ -173,7 +184,7 @@ type Guild struct {
|
||||||
type GuildParams struct {
|
type GuildParams struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Region string `json:"region"`
|
Region string `json:"region"`
|
||||||
VerificationLevel *int `json:"verification_level"`
|
VerificationLevel *VerificationLevel `json:"verification_level"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// A Role stores information about Discord guild member roles.
|
// A Role stores information about Discord guild member roles.
|
||||||
|
|
Loading…
Reference in a new issue