From 65afa699ef10ed6128ebbf39dcf921581febea33 Mon Sep 17 00:00:00 2001 From: Samuel Hernandez Date: Sun, 4 Aug 2024 03:52:24 -0400 Subject: [PATCH] gateway: add missing Event suffix to GuildMemberListUpdateEvent --- gateway/event_methods.go | 7 +++++++ gateway/events.go | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gateway/event_methods.go b/gateway/event_methods.go index a2fd61f..1bb2e70 100644 --- a/gateway/event_methods.go +++ b/gateway/event_methods.go @@ -40,6 +40,7 @@ func init() { func() ws.Event { return new(GuildMemberRemoveEvent) }, func() ws.Event { return new(GuildMemberUpdateEvent) }, func() ws.Event { return new(GuildMembersChunkEvent) }, + func() ws.Event { return new(GuildMemberListUpdateEvent) }, func() ws.Event { return new(GuildRoleCreateEvent) }, func() ws.Event { return new(GuildRoleUpdateEvent) }, func() ws.Event { return new(GuildRoleDeleteEvent) }, @@ -284,6 +285,12 @@ func (*GuildMembersChunkEvent) Op() ws.OpCode { return dispatchOp } // EventType implements Event. func (*GuildMembersChunkEvent) EventType() ws.EventType { return "GUILD_MEMBERS_CHUNK" } +// Op implements Event. It always returns 0. +func (*GuildMemberListUpdateEvent) Op() ws.OpCode { return dispatchOp } + +// EventType implements Event. +func (*GuildMemberListUpdateEvent) EventType() ws.EventType { return "GUILD_MEMBER_LIST_UPDATE" } + // Op implements Event. It always returns 0. func (*GuildRoleCreateEvent) Op() ws.OpCode { return dispatchOp } diff --git a/gateway/events.go b/gateway/events.go index a14eca5..07d7716 100644 --- a/gateway/events.go +++ b/gateway/events.go @@ -390,10 +390,10 @@ type GuildMembersChunkEvent struct { Nonce string `json:"nonce,omitempty"` } -// GuildMemberListUpdate is a dispatch event. It is an undocumented event. It's -// received when the client sends over GuildSubscriptions with the Channels -// field used. The State package does not handle this event. -type GuildMemberListUpdate struct { +// GuildMemberListUpdateEvent is a dispatch event. It is an undocumented event. +// It's received when the client sends over GuildSubscriptions with the Channels +// field used. The State package does not handle this event. +type GuildMemberListUpdateEvent struct { ID string `json:"id"` GuildID discord.GuildID `json:"guild_id"` MemberCount uint64 `json:"member_count"`