浏览代码

Prime the channel map correctly.

Chris Rhodes 8 年之前
父节点
当前提交
4609c31a72
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      state.go

+ 7 - 1
state.go

@@ -41,11 +41,17 @@ func (s *State) OnReady(r *Ready) error {
 	s.Ready = *r
 
 	for _, g := range s.Guilds {
+		s.guildMap[g.ID] = g
+
 		for _, c := range g.Channels {
 			c.GuildID = g.ID
+
+			s.channelMap[c.ID] = c
 		}
+	}
 
-		s.guildMap[g.ID] = g
+	for _, c := range s.PrivateChannels {
+		s.channelMap[c.ID] = c
 	}
 
 	return nil