From d6e795c573539dd0eea92917e5c94acbd0508169 Mon Sep 17 00:00:00 2001 From: Chris Rhodes Date: Mon, 23 Jul 2018 20:09:49 -0700 Subject: [PATCH] Make sure MemberCount isn't stomped when Guilds are added. --- state.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/state.go b/state.go index 695f47c..3a4643f 100644 --- a/state.go +++ b/state.go @@ -99,6 +99,9 @@ func (s *State) GuildAdd(guild *Guild) error { if g, ok := s.guildMap[guild.ID]; ok { // We are about to replace `g` in the state with `guild`, but first we need to // make sure we preserve any fields that the `guild` doesn't contain from `g`. + if guild.MemberCount == 0 { + guild.MemberCount = g.MemberCount + } if guild.Roles == nil { guild.Roles = g.Roles }