From a72e5bc0c4b5c2f30f583865b7e6ccb813f66e12 Mon Sep 17 00:00:00 2001 From: sneak Date: Tue, 8 Sep 2020 19:31:18 -0700 Subject: [PATCH] process bot commands first, debugging channel messages last --- bot/bot.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bot/bot.go b/bot/bot.go index 7378166..4b65aee 100644 --- a/bot/bot.go +++ b/bot/bot.go @@ -208,16 +208,17 @@ func (b *Bot) HandleWebSocketResponse(event *model.WebSocketEvent) { return } - if event.Broadcast.ChannelId == b.debuggingChannel.Id { - b.HandleMsgFromDebuggingChannel(event) - return - } - // check to see if we have been addressed if matched, _ := regexp.MatchString(`^\s*`+b.BotName+`\s*`, post.Message); matched { println("i have been addressed in channel " + post.ChannelId) //b.SendMsgToDebuggingChannel("i have been addressed in channel "+post.ChannelId, "") b.HandleMsgFromChannel(event) + return + } + + if event.Broadcast.ChannelId == b.debuggingChannel.Id { + b.HandleMsgFromDebuggingChannel(event) + return } }