process bot commands first, debugging channel messages last
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
cfec102364
commit
a72e5bc0c4
11
bot/bot.go
11
bot/bot.go
@ -208,16 +208,17 @@ func (b *Bot) HandleWebSocketResponse(event *model.WebSocketEvent) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if event.Broadcast.ChannelId == b.debuggingChannel.Id {
|
|
||||||
b.HandleMsgFromDebuggingChannel(event)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// check to see if we have been addressed
|
// check to see if we have been addressed
|
||||||
if matched, _ := regexp.MatchString(`^\s*`+b.BotName+`\s*`, post.Message); matched {
|
if matched, _ := regexp.MatchString(`^\s*`+b.BotName+`\s*`, post.Message); matched {
|
||||||
println("i have been addressed in channel " + post.ChannelId)
|
println("i have been addressed in channel " + post.ChannelId)
|
||||||
//b.SendMsgToDebuggingChannel("i have been addressed in channel "+post.ChannelId, "")
|
//b.SendMsgToDebuggingChannel("i have been addressed in channel "+post.ChannelId, "")
|
||||||
b.HandleMsgFromChannel(event)
|
b.HandleMsgFromChannel(event)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if event.Broadcast.ChannelId == b.debuggingChannel.Id {
|
||||||
|
b.HandleMsgFromDebuggingChannel(event)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user