Fix channels inside a guild from GUILD_CREATE having a null GuildID

This commit is contained in:
andrei 2016-03-19 18:58:47 -07:00
parent 192bbf3da9
commit 7e7887a936

View file

@ -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
}