Compare commits

...

2 Commits

Author SHA1 Message Date
Jeffrey Paul f5fe993105 Merge branch 'next' of sneak/sco into master
continuous-integration/drone/push Build is passing Details
2020-09-13 07:54:22 +00:00
Jeffrey Paul b182c18d49 should now allow "bot" address too
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2020-09-13 00:49:19 -07:00
1 changed files with 9 additions and 0 deletions

View File

@ -221,6 +221,8 @@ func (b *Bot) HandleWebSocketResponse(event *model.WebSocketEvent) {
return
}
// FIXME check for parts and joins and whatnot and ignore those
// 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)
@ -229,6 +231,13 @@ func (b *Bot) HandleWebSocketResponse(event *model.WebSocketEvent) {
return
}
if matched, _ := regexp.MatchString(`^\s*bot([\,]?)\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