Skip to content

Commit

Permalink
Merge branch 'master' into feature/user-apps
Browse files Browse the repository at this point in the history
  • Loading branch information
sebm253 committed Mar 20, 2024
2 parents 75d65aa + 0f6192b commit 7d50e10
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 22 deletions.
16 changes: 9 additions & 7 deletions discord/application.go
Expand Up @@ -244,23 +244,25 @@ func (t Team) CreatedAt() time.Time {
}

type TeamMember struct {
MembershipState MembershipState `json:"membership_state"`
Permissions []TeamPermissions `json:"permissions"`
TeamID snowflake.ID `json:"team_id"`
User User `json:"user"`
MembershipState MembershipState `json:"membership_state"`
TeamID snowflake.ID `json:"team_id"`
User User `json:"user"`
Role TeamRole `json:"role"`
}

type MembershipState int

const (
MembershipStateInvited = iota + 1
MembershipStateInvited MembershipState = iota + 1
MembershipStateAccepted
)

type TeamPermissions string
type TeamRole string

const (
TeamPermissionAdmin = "*"
TeamRoleAdmin TeamRole = "admin"
TeamRoleDeveloper TeamRole = "developer"
TeamRoleReadOnly TeamRole = "read_only"
)

type ApplicationIntegrationType int
Expand Down
2 changes: 1 addition & 1 deletion discord/application_command.go
Expand Up @@ -11,7 +11,7 @@ import (
type ApplicationCommandType int

const (
ApplicationCommandTypeSlash = iota + 1
ApplicationCommandTypeSlash ApplicationCommandType = iota + 1
ApplicationCommandTypeUser
ApplicationCommandTypeMessage
)
Expand Down
2 changes: 1 addition & 1 deletion discord/application_command_permission.go
Expand Up @@ -12,7 +12,7 @@ type ApplicationCommandPermissionType int

// types of ApplicationCommandPermissionType
const (
ApplicationCommandPermissionTypeRole = iota + 1
ApplicationCommandPermissionTypeRole ApplicationCommandPermissionType = iota + 1
ApplicationCommandPermissionTypeUser
ApplicationCommandPermissionTypeChannel
)
Expand Down
2 changes: 1 addition & 1 deletion discord/channel.go
Expand Up @@ -1308,7 +1308,7 @@ type PartialChannel struct {
type VideoQualityMode int

const (
VideoQualityModeAuto = iota + 1
VideoQualityModeAuto VideoQualityMode = iota + 1
VideoQualityModeFull
)

Expand Down
6 changes: 3 additions & 3 deletions discord/component.go
Expand Up @@ -12,7 +12,7 @@ type ComponentType int

// Supported ComponentType(s)
const (
ComponentTypeActionRow = iota + 1
ComponentTypeActionRow ComponentType = iota + 1
ComponentTypeButton
ComponentTypeStringSelectMenu
ComponentTypeTextInput
Expand Down Expand Up @@ -229,7 +229,7 @@ type ButtonStyle int

// Supported ButtonStyle(s)
const (
ButtonStylePrimary = iota + 1
ButtonStylePrimary ButtonStyle = iota + 1
ButtonStyleSecondary
ButtonStyleSuccess
ButtonStyleDanger
Expand Down Expand Up @@ -459,6 +459,6 @@ func (c TextInputComponent) WithValue(value string) TextInputComponent {
type TextInputStyle int

const (
TextInputStyleShort = iota + 1
TextInputStyleShort TextInputStyle = iota + 1
TextInputStyleParagraph
)
18 changes: 9 additions & 9 deletions handler/mux.go
Expand Up @@ -205,7 +205,7 @@ func (r *Mux) SlashCommand(pattern string, h SlashCommandHandler) {
pattern: pattern,
handler: h,
t: discord.InteractionTypeApplicationCommand,
t2: []int{discord.ApplicationCommandTypeSlash},
t2: []int{int(discord.ApplicationCommandTypeSlash)},
})
}

Expand All @@ -216,7 +216,7 @@ func (r *Mux) UserCommand(pattern string, h UserCommandHandler) {
pattern: pattern,
handler: h,
t: discord.InteractionTypeApplicationCommand,
t2: []int{discord.ApplicationCommandTypeUser},
t2: []int{int(discord.ApplicationCommandTypeUser)},
})
}

Expand All @@ -227,7 +227,7 @@ func (r *Mux) MessageCommand(pattern string, h MessageCommandHandler) {
pattern: pattern,
handler: h,
t: discord.InteractionTypeApplicationCommand,
t2: []int{discord.ApplicationCommandTypeMessage},
t2: []int{int(discord.ApplicationCommandTypeMessage)},
})
}

Expand Down Expand Up @@ -258,7 +258,7 @@ func (r *Mux) ButtonComponent(pattern string, h ButtonComponentHandler) {
pattern: pattern,
handler: h,
t: discord.InteractionTypeComponent,
t2: []int{discord.ComponentTypeButton},
t2: []int{int(discord.ComponentTypeButton)},
})
}

Expand All @@ -270,11 +270,11 @@ func (r *Mux) SelectMenuComponent(pattern string, h SelectMenuComponentHandler)
handler: h,
t: discord.InteractionTypeComponent,
t2: []int{
discord.ComponentTypeStringSelectMenu,
discord.ComponentTypeUserSelectMenu,
discord.ComponentTypeRoleSelectMenu,
discord.ComponentTypeMentionableSelectMenu,
discord.ComponentTypeChannelSelectMenu,
int(discord.ComponentTypeStringSelectMenu),
int(discord.ComponentTypeUserSelectMenu),
int(discord.ComponentTypeRoleSelectMenu),
int(discord.ComponentTypeMentionableSelectMenu),
int(discord.ComponentTypeChannelSelectMenu),
},
})
}
Expand Down

0 comments on commit 7d50e10

Please sign in to comment.