瀏覽代碼

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

Fix channels from a GUILD_CREATE packet having null GuildID's
Bruce 8 年之前
父節點
當前提交
c3b2a1b57d
共有 1 個文件被更改,包括 5 次插入0 次删除
  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
 }