Browse Source

Make sure MemberCount isn't stomped when Guilds are added.

Chris Rhodes 6 years ago
parent
commit
d6e795c573
1 changed files with 3 additions and 0 deletions
  1. 3 0
      state.go

+ 3 - 0
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
 		}