Skip to content

Commit

Permalink
fix(guild/members): correctly differentiate member list update/insert…
Browse files Browse the repository at this point in the history
… events

mistakenly lumped all insertions under updates too
  • Loading branch information
cryptoAlgorithm committed Mar 16, 2024
1 parent 50fb7f3 commit 364c34f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ public struct GuildMemberListUpdate: Decodable, GatewayData {
switch op {
case .sync:
self = .sync(try container.decode([Data].self, forKey: .items), range: try container.decode(DiscordRange.self, forKey: .range))
case .update, .insert:
case .update:
self = .update(try container.decode(Data.self, forKey: .item), index: try container.decode(Int.self, forKey: .index))
case .insert:
self = .insert(try container.decode(Data.self, forKey: .item), index: try container.decode(Int.self, forKey: .index))
case .delete:
self = .delete(try container.decode(Int.self, forKey: .index))
}
Expand Down

0 comments on commit 364c34f

Please sign in to comment.