|
@@ -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()
|