feat: add state log handler
This commit is contained in:
parent
6cebbbd0a3
commit
ad49eee3ec
1 changed files with 5 additions and 0 deletions
|
|
@ -45,10 +45,15 @@ func openState(token string) error {
|
|||
discordState.AddHandler(discordState.onMessageDelete)
|
||||
discordState.AddHandler(discordState.onGetMemberChunk)
|
||||
|
||||
discordState.StateLog = discordState.onStateLog
|
||||
discordState.OnRequest = append(discordState.OnRequest, discordState.onRequest)
|
||||
return discordState.Open(context.TODO())
|
||||
}
|
||||
|
||||
func (s *State) onStateLog(err error) {
|
||||
slog.Error("state log", "err", err)
|
||||
}
|
||||
|
||||
func (s *State) onRequest(r httpdriver.Request) error {
|
||||
req, ok := r.(*httpdriver.DefaultRequest)
|
||||
if ok {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue