Skip to content

Commit

Permalink
fix: Pass activity by reference in ActivityOpt (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
apricotbucket28 authored Feb 4, 2025
1 parent 25685c9 commit 5e299d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gateway/gateway_messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ func WithCompetingActivity(name string, opts ...ActivityOpt) PresenceOpt {
func withActivity(activity discord.Activity, opts ...ActivityOpt) PresenceOpt {
return func(presence *MessageDataPresenceUpdate) {
for _, opt := range opts {
opt(activity)
opt(&activity)
}
presence.Activities = []discord.Activity{activity}
}
Expand Down Expand Up @@ -615,11 +615,11 @@ func WithSince(since *int64) PresenceOpt {
}

// ActivityOpt is a type alias for a function that sets optional data for an Activity
type ActivityOpt func(activity discord.Activity)
type ActivityOpt func(activity *discord.Activity)

// WithActivityState sets the Activity.State
func WithActivityState(state string) ActivityOpt {
return func(activity discord.Activity) {
return func(activity *discord.Activity) {
activity.State = &state
}
}
Expand Down

0 comments on commit 5e299d1

Please sign in to comment.