Complement GuildParams struct to comply with Discord's API (#1255)

* 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>
This commit is contained in:
Ringo Hoffmann 2022-12-17 21:03:18 +01:00 committed by GitHub
parent 9effc92908
commit e741fc2790
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1063,8 +1063,10 @@ type SystemChannelFlag int
// Block containing known SystemChannelFlag values
const (
SystemChannelFlagsSuppressJoin SystemChannelFlag = 1 << 0
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.
@ -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.