Skip to content

Commit

Permalink
dont use pointer for InteractionContextType
Browse files Browse the repository at this point in the history
  • Loading branch information
sebm253 committed Apr 7, 2024
1 parent 5bea14e commit 4a3a8e5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions discord/interaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type rawInteraction struct {
AppPermissions *Permissions `json:"app_permissions,omitempty"`
Entitlements []Entitlement `json:"entitlements"`
AuthorizingIntegrationOwners map[ApplicationIntegrationType]snowflake.ID `json:"authorizing_integration_owners"`
Context *InteractionContextType `json:"context"`
Context InteractionContextType `json:"context"`
}

// Interaction is used for easier unmarshalling of different Interaction(s)
Expand All @@ -66,7 +66,7 @@ type Interaction interface {
AppPermissions() *Permissions
Entitlements() []Entitlement
AuthorizingIntegrationOwners() map[ApplicationIntegrationType]snowflake.ID
Context() *InteractionContextType
Context() InteractionContextType
CreatedAt() time.Time

interaction()
Expand Down
4 changes: 2 additions & 2 deletions discord/interaction_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type baseInteraction struct {
appPermissions *Permissions
entitlements []Entitlement
authorizingIntegrationOwners map[ApplicationIntegrationType]snowflake.ID
context *InteractionContextType
context InteractionContextType
}

func (i baseInteraction) ID() snowflake.ID {
Expand Down Expand Up @@ -75,7 +75,7 @@ func (i baseInteraction) AuthorizingIntegrationOwners() map[ApplicationIntegrati
return i.authorizingIntegrationOwners
}

func (i baseInteraction) Context() *InteractionContextType {
func (i baseInteraction) Context() InteractionContextType {
return i.context
}

Expand Down
4 changes: 2 additions & 2 deletions discord/interaction_ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ func (PingInteraction) AuthorizingIntegrationOwners() map[ApplicationIntegration
return nil
}

func (PingInteraction) Context() *InteractionContextType {
return nil
func (PingInteraction) Context() InteractionContextType {
return 0
}

func (PingInteraction) interaction() {}

0 comments on commit 4a3a8e5

Please sign in to comment.