mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-01-08 13:07:43 +00:00
Gateway: Added missing GuildCreateEvent handler
This commit is contained in:
parent
a25250d959
commit
65092354c0
|
@ -69,7 +69,7 @@ func (s *State) onEvent(iface interface{}) {
|
|||
|
||||
// Handle guilds
|
||||
for i := range ev.Guilds {
|
||||
s.batchLog(storeGuildCreate(s.Store, &ev.Guilds[i])...)
|
||||
s.batchLog(storeGuildCreate(s.Store, &ev.Guilds[i]))
|
||||
}
|
||||
|
||||
// Handle private channels
|
||||
|
@ -84,6 +84,9 @@ func (s *State) onEvent(iface interface{}) {
|
|||
s.stateErr(err, "failed to set self in state")
|
||||
}
|
||||
|
||||
case *gateway.GuildCreateEvent:
|
||||
s.batchLog(storeGuildCreate(s.Store, ev))
|
||||
|
||||
case *gateway.GuildUpdateEvent:
|
||||
if err := s.Store.GuildSet(ev.Guild); err != nil {
|
||||
s.stateErr(err, "failed to update guild in state")
|
||||
|
@ -299,7 +302,7 @@ func (s *State) onEvent(iface interface{}) {
|
|||
func (s *State) stateErr(err error, wrap string) {
|
||||
s.StateLog(errors.Wrap(err, wrap))
|
||||
}
|
||||
func (s *State) batchLog(errors ...error) {
|
||||
func (s *State) batchLog(errors []error) {
|
||||
for _, err := range errors {
|
||||
s.StateLog(err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue