diff --git a/state.go b/state.go index 2c3f0ea..d313e12 100644 --- a/state.go +++ b/state.go @@ -58,11 +58,12 @@ func (s *State) GuildAdd(guild *Guild) error { return ErrNilState } - // Otherwise, update the channels to point to the right guild + // Update the channels to point to the right guild for _, c := range guild.Channels { c.GuildID = guild.ID } + // If the guild exists, replace it. if g, err := s.Guild(guild.ID); err == nil { s.Lock() defer s.Unlock() @@ -215,6 +216,7 @@ func (s *State) ChannelAdd(channel *Channel) error { return ErrNilState } + // If the channel exists, replace it. if c, err := s.Channel(channel.ID); err == nil { s.Lock() defer s.Unlock()