feat(cmd): add debug statement for unknown events
This commit is contained in:
parent
00b3e8f088
commit
ab78e85d1b
1 changed files with 6 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ package cmd
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"runtime"
|
||||
|
||||
|
|
@ -38,6 +39,7 @@ func openState(token string) error {
|
|||
}
|
||||
|
||||
// Handlers
|
||||
discordState.AddHandler(discordState.onEvent)
|
||||
discordState.AddHandler(discordState.onReady)
|
||||
discordState.AddHandler(discordState.onMessageCreate)
|
||||
discordState.AddHandler(discordState.onMessageDelete)
|
||||
|
|
@ -55,6 +57,10 @@ func (s *State) onRequest(r httpdriver.Request) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (s *State) onEvent(event any) {
|
||||
slog.Debug("new gateway event", "name", fmt.Sprintf("%T", event), "data", event)
|
||||
}
|
||||
|
||||
func (s *State) onReady(r *gateway.ReadyEvent) {
|
||||
root := app.guildsTree.GetRoot()
|
||||
root.ClearChildren()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue