浏览代码

Merge pull request #164 from iopred/develop

Prime the channel map correctly.
Bruce 8 年之前
父节点
当前提交
6abc247a2d
共有 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