mirror of
https://github.com/Fluffy-Bean/Lynxie.git
synced 2025-06-12 13:43:12 +00:00
Basic panic recovery
This commit is contained in:
parent
98dd655ddd
commit
37314f48b5
1 changed files with 9 additions and 0 deletions
|
@ -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 {
|
if h.Message.Author.ID == h.Session.State.User.ID {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue