Skip to content

Commit

Permalink
Reuse GuildOnboarding struct
Browse files Browse the repository at this point in the history
  • Loading branch information
Earlopain committed Aug 14, 2023
1 parent 34f0fa5 commit 7534059
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
4 changes: 2 additions & 2 deletions restapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -3267,8 +3267,8 @@ func (s *Session) GuildOnboarding(guildID string, options ...RequestOption) (onb

// GuildOnboardingEdit edits Onboarding for a Guild.
// guildID : The ID of a Guild.
// o : A GuildOnboardingParams struct.
func (s *Session) GuildOnboardingEdit(guildID string, o *GuildOnboardingParams, options ...RequestOption) (onboarding *GuildOnboarding, err error) {
// o : A GuildOnboarding struct.
func (s *Session) GuildOnboardingEdit(guildID string, o *GuildOnboarding, options ...RequestOption) (onboarding *GuildOnboarding, err error) {
endpoint := EndpointGuildOnboarding(guildID)

var body []byte
Expand Down
22 changes: 3 additions & 19 deletions structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1086,35 +1086,19 @@ const (
// https://discord.com/developers/docs/resources/guild#guild-onboarding-object
type GuildOnboarding struct {
// ID of the guild this onboarding is part of.
GuildID string `json:"guild_id"`

// Prompts shown during onboarding and in the Channel & Roles tab.
Prompts []GuildOnboardingPrompt `json:"prompts"`

// Channel IDs that members get opted into automatically.
DefaultChannelIDs []string `json:"default_channel_ids"`
GuildID string `json:"guild_id,omitempty"`

// Whether onboarding is enabled in the guild.
Enabled bool `json:"enabled"`

// Current mode of onboarding.
Mode GuildOnboardingMode `json:"mode"`
}

// GuildOnboardingParams stores all the data needed to update discord onboarding settings.
// https://discord.com/developers/docs/resources/guild#modify-guild-onboarding-json-params
type GuildOnboardingParams struct {
// Prompts shown during onboarding and in the Channel & Roles tab.
Prompts []GuildOnboardingPrompt `json:"prompts,omitempty"`

// Channel IDs that members get opted into automatically.
DefaultChannelIDs []string `json:"default_channel_ids,omitempty"`

// Whether onboarding is enabled.
// Whether onboarding is enabled in the guild.
Enabled *bool `json:"enabled,omitempty"`

// Mode of onboarding.
Mode GuildOnboardingMode `json:"mode,omitempty"`
Mode *GuildOnboardingMode `json:"mode,omitempty"`
}

// GuildOnboardingPrompt is a prompt shown during onboarding and in customize community.
Expand Down

0 comments on commit 7534059

Please sign in to comment.