Explorar o código

Merge pull request #154 from b1naryth1ef/bugfix/guild-add-channels

Fix channels from a GUILD_CREATE packet having null GuildID's
Bruce %!s(int64=8) %!d(string=hai) anos
pai
achega
c3b2a1b57d
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      state.go

+ 5 - 0
state.go

@@ -73,6 +73,11 @@ func (s *State) GuildAdd(guild *Guild) error {
 		}
 	}
 
+	// Otherwise, update the channels to point to the right guild
+	for _, c := range guild.Channels {
+		c.GuildID = guild.ID
+	}
+
 	s.Guilds = append(s.Guilds, guild)
 	return nil
 }