From b1cae780962f0adb9d27cd92d9e529c3c4c7fa60 Mon Sep 17 00:00:00 2001 From: diamondburned Date: Sun, 8 Aug 2021 13:53:24 -0700 Subject: [PATCH] bot: Stop message handling on middleware errors --- bot/ctx_call.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bot/ctx_call.go b/bot/ctx_call.go index f4cf083..7fbf8c1 100644 --- a/bot/ctx_call.go +++ b/bot/ctx_call.go @@ -59,6 +59,10 @@ func (ctx *Context) callCmd(ev interface{}) (bottomError error) { } } + if bottomError != nil { + return bottomError + } + var msc *gateway.MessageCreateEvent // We call the messages later, since we want MessageCreate middlewares to