Basic panic recovery

This commit is contained in:
Michał Gdula 2025-05-08 18:36:04 +01:00
parent 98dd655ddd
commit 37314f48b5

View file

@ -85,6 +85,15 @@ func (a *App) handler(session *discordgo.Session, message *discordgo.MessageCrea
},
}
defer func() {
if r := recover(); r != nil {
printError(a, h, Error{
Msg: "panic!",
Err: fmt.Errorf("%v", r),
})
}
}()
if h.Message.Author.ID == h.Session.State.User.ID {
return
}