Skip to content

Commit

Permalink
Complement GuildParams struct to comply with Discord's API (#1255)
Browse files Browse the repository at this point in the history
* complement `GuildParams` struct [fix #994]

* fix: naming and spelling

* fix: gofmt

* refactor: use Locale type for PreferredLocale

Co-authored-by: zekro <private@zekro.de>
Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
  • Loading branch information
3 people authored Dec 17, 2022
1 parent 9effc92 commit e741fc2
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1063,8 +1063,10 @@ type SystemChannelFlag int

// Block containing known SystemChannelFlag values
const (
SystemChannelFlagsSuppressJoin SystemChannelFlag = 1 << 0
SystemChannelFlagsSuppressPremium SystemChannelFlag = 1 << 1
SystemChannelFlagsSuppressJoinNotifications SystemChannelFlag = 1 << 0
SystemChannelFlagsSuppressPremium SystemChannelFlag = 1 << 1
SystemChannelFlagsSupressGuildReminderNotifications SystemChannelFlag = 1 << 2
SystemChannelFlagsSupressJoinNotificationReplies SystemChannelFlag = 1 << 3
)

// IconURL returns a URL to the guild's icon.
Expand Down Expand Up @@ -1132,12 +1134,22 @@ type GuildParams struct {
Region string `json:"region,omitempty"`
VerificationLevel *VerificationLevel `json:"verification_level,omitempty"`
DefaultMessageNotifications int `json:"default_message_notifications,omitempty"` // TODO: Separate type?
ExplicitContentFilter int `json:"explicit_content_filter,omitempty"`
AfkChannelID string `json:"afk_channel_id,omitempty"`
AfkTimeout int `json:"afk_timeout,omitempty"`
Icon string `json:"icon,omitempty"`
OwnerID string `json:"owner_id,omitempty"`
Splash string `json:"splash,omitempty"`
DiscoverySplash string `json:"discovery_splash,omitempty"`
Banner string `json:"banner,omitempty"`
SystemChannelID string `json:"system_channel_id,omitempty"`
SystemChannelFlags SystemChannelFlag `json:"system_channel_flags,omitempty"`
RulesChannelID string `json:"rules_channel_id,omitempty"`
PublicUpdatesChannelID string `json:"public_updates_channel_id,omitempty"`
PreferredLocale Locale `json:"preferred_locale,omitempty"`
Features []GuildFeature `json:"features,omitempty"`
Description string `json:"description,omitempty"`
PremiumProgressBarEnabled bool `json:"premium_progress_bar_enabled,omitempty"`
}

// A Role stores information about Discord guild member roles.
Expand Down

0 comments on commit e741fc2

Please sign in to comment.