1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-12-01 03:03:48 +00:00
This commit is contained in:
diamondburned 2020-01-17 14:36:53 -08:00
parent 2dc983d243
commit 35cad7f640

View file

@ -18,7 +18,6 @@ type State struct {
PreHandler *handler.Handler PreHandler *handler.Handler
guilds []discord.Guild guilds []discord.Guild
channels []discord.Channel
privates []discord.Channel privates []discord.Channel
messages map[discord.Snowflake][]discord.Message messages map[discord.Snowflake][]discord.Message
@ -55,8 +54,15 @@ func (s *State) hookSession() error {
s.PreHandler.Call(iface) s.PreHandler.Call(iface)
} }
s.mut.Lock()
defer s.mut.Unlock()
switch ev := iface.(type) { switch ev := iface.(type) {
case *gateway.ReadyEvent: case *gateway.ReadyEvent:
// Override
s.guilds = ev.Guilds
s.privates = ev.PrivateChannels
case *gateway.MessageCreateEvent: case *gateway.MessageCreateEvent:
_ = ev _ = ev
panic("IMPLEMENT ME") panic("IMPLEMENT ME")