diff --git a/events/guild_soundboard_events.go b/events/guild_soundboard_events.go index 0bce60aa..8064fd9d 100644 --- a/events/guild_soundboard_events.go +++ b/events/guild_soundboard_events.go @@ -33,6 +33,7 @@ type GuildSoundboardSoundDelete struct { type GuildSoundboardSoundsUpdate struct { *GenericEvent SoundboardSounds []discord.SoundboardSound + GuildID snowflake.ID } // SoundboardSounds is a response to gateway.OpcodeRequestSoundboardSounds diff --git a/gateway/gateway_events.go b/gateway/gateway_events.go index fdfa6acc..2d77af4a 100644 --- a/gateway/gateway_events.go +++ b/gateway/gateway_events.go @@ -463,7 +463,10 @@ type EventGuildSoundboardSoundDelete struct { func (EventGuildSoundboardSoundDelete) messageData() {} func (EventGuildSoundboardSoundDelete) eventData() {} -type EventGuildSoundboardSoundsUpdate []discord.SoundboardSound +type EventGuildSoundboardSoundsUpdate struct { + SoundboardSounds []discord.SoundboardSound `json:"soundboard_sounds"` + GuildID snowflake.ID `json:"guild_id"` +} func (EventGuildSoundboardSoundsUpdate) messageData() {} func (EventGuildSoundboardSoundsUpdate) eventData() {} diff --git a/handlers/guild_soundboard_handlers.go b/handlers/guild_soundboard_handlers.go index 6ee340c2..6c775bfd 100644 --- a/handlers/guild_soundboard_handlers.go +++ b/handlers/guild_soundboard_handlers.go @@ -41,13 +41,14 @@ func gatewayHandlerGuildSoundboardSoundDelete(client bot.Client, sequenceNumber } func gatewayHandlerGuildSoundboardSoundsUpdate(client bot.Client, sequenceNumber int, shardID int, event gateway.EventGuildSoundboardSoundsUpdate) { - for _, sound := range event { + for _, sound := range event.SoundboardSounds { client.Caches().AddGuildSoundboardSound(sound) } client.EventManager().DispatchEvent(&events.GuildSoundboardSoundsUpdate{ GenericEvent: events.NewGenericEvent(client, sequenceNumber, shardID), - SoundboardSounds: event, + SoundboardSounds: event.SoundboardSounds, + GuildID: event.GuildID, }) }