From d2253dd7020b8e99a10b487346b7d0274fcbfdf1 Mon Sep 17 00:00:00 2001 From: sebm253 <42180891+sebm253@users.noreply.github.com> Date: Fri, 16 Aug 2024 18:41:58 +0200 Subject: [PATCH 1/2] add required intent + fix docs --- events/guild_voice_events.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/events/guild_voice_events.go b/events/guild_voice_events.go index b9543ee9..3f8d4593 100644 --- a/events/guild_voice_events.go +++ b/events/guild_voice_events.go @@ -5,37 +5,37 @@ import ( "github.com/disgoorg/disgo/gateway" ) -// GuildVoiceChannelEffectSend indicates that a discord.User sent an effect in a discord.GuildVoiceChannel +// GuildVoiceChannelEffectSend indicates that a discord.Member sent an effect in a discord.GuildVoiceChannel (requires gateway.IntentGuildVoiceStates) type GuildVoiceChannelEffectSend struct { *GenericEvent gateway.EventVoiceChannelEffectSend } -// GenericGuildVoiceState is called upon receiving GuildVoiceJoin , GuildVoiceMove , GuildVoiceLeave +// GenericGuildVoiceState is called upon receiving GuildVoiceJoin, GuildVoiceMove and GuildVoiceLeave type GenericGuildVoiceState struct { *GenericEvent VoiceState discord.VoiceState Member discord.Member } -// GuildVoiceStateUpdate indicates that the discord.VoiceState of a discord.Member has updated(requires gateway.IntentsGuildVoiceStates) +// GuildVoiceStateUpdate indicates that the discord.VoiceState of a discord.Member has updated (requires gateway.IntentGuildVoiceStates) type GuildVoiceStateUpdate struct { *GenericGuildVoiceState OldVoiceState discord.VoiceState } -// GuildVoiceJoin indicates that a discord.Member joined a discord.Channel(requires gateway.IntentsGuildVoiceStates) +// GuildVoiceJoin indicates that a discord.Member joined a discord.GuildVoiceChannel (requires gateway.IntentGuildVoiceStates) type GuildVoiceJoin struct { *GenericGuildVoiceState } -// GuildVoiceMove indicates that a discord.Member moved a discord.Channel(requires gateway.IntentsGuildVoiceStates) +// GuildVoiceMove indicates that a discord.Member was moved to a different discord.GuildVoiceChannel (requires gateway.IntentGuildVoiceStates) type GuildVoiceMove struct { *GenericGuildVoiceState OldVoiceState discord.VoiceState } -// GuildVoiceLeave indicates that a discord.Member left a discord.Channel(requires gateway.IntentsGuildVoiceStates) +// GuildVoiceLeave indicates that a discord.Member left a discord.GuildVoiceChannel (requires gateway.IntentGuildVoiceStates) type GuildVoiceLeave struct { *GenericGuildVoiceState OldVoiceState discord.VoiceState From ae06f00b08b53dde89a902eea420d22435ce0e65 Mon Sep 17 00:00:00 2001 From: sebm253 <42180891+sebm253@users.noreply.github.com> Date: Fri, 16 Aug 2024 18:46:20 +0200 Subject: [PATCH 2/2] SoundboardEffectAnimationType -> VoiceChannelEffectAnimationType --- discord/soundboard.go | 6 +++--- gateway/gateway_events.go | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/discord/soundboard.go b/discord/soundboard.go index 37f769d8..c8df7d90 100644 --- a/discord/soundboard.go +++ b/discord/soundboard.go @@ -1,8 +1,8 @@ package discord -type SoundboardEffectAnimationType int +type VoiceChannelEffectAnimationType int const ( - SoundboardEffectAnimationTypePremium SoundboardEffectAnimationType = iota - SoundboardEffectAnimationTypeBasic + VoiceChannelEffectAnimationTypePremium VoiceChannelEffectAnimationType = iota + VoiceChannelEffectAnimationTypeBasic ) diff --git a/gateway/gateway_events.go b/gateway/gateway_events.go index 4823ff26..a6972697 100644 --- a/gateway/gateway_events.go +++ b/gateway/gateway_events.go @@ -604,14 +604,14 @@ func (EventUserUpdate) messageData() {} func (EventUserUpdate) eventData() {} type EventVoiceChannelEffectSend struct { - ChannelID snowflake.ID `json:"channel_id"` - GuildID snowflake.ID `json:"guild_id"` - UserID snowflake.ID `json:"user_id"` - Emoji *discord.Emoji `json:"emoji"` - AnimationType *discord.SoundboardEffectAnimationType `json:"animation_type,omitempty"` - AnimationID *int `json:"animation_id,omitempty"` - SoundID *snowflake.ID `json:"sound_id,omitempty"` - SoundVolume *float64 `json:"sound_volume,omitempty"` + ChannelID snowflake.ID `json:"channel_id"` + GuildID snowflake.ID `json:"guild_id"` + UserID snowflake.ID `json:"user_id"` + Emoji *discord.Emoji `json:"emoji"` + AnimationType *discord.VoiceChannelEffectAnimationType `json:"animation_type,omitempty"` + AnimationID *int `json:"animation_id,omitempty"` + SoundID *snowflake.ID `json:"sound_id,omitempty"` + SoundVolume *float64 `json:"sound_volume,omitempty"` } func (EventVoiceChannelEffectSend) messageData() {}