Merge pull request #164 from iopred/develop
Prime the channel map correctly.
This commit is contained in:
commit
6abc247a2d
1 changed files with 8 additions and 2 deletions
10
state.go
10
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.guildMap[g.ID] = g
|
||||
s.channelMap[c.ID] = c
|
||||
}
|
||||
}
|
||||
|
||||
for _, c := range s.PrivateChannels {
|
||||
s.channelMap[c.ID] = c
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue