should now allow "bot" address too #5
@ -221,6 +221,8 @@ func (b *Bot) HandleWebSocketResponse(event *model.WebSocketEvent) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME check for parts and joins and whatnot and ignore those
|
||||||
|
|
||||||
// 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)
|
||||||
@ -229,6 +231,13 @@ func (b *Bot) HandleWebSocketResponse(event *model.WebSocketEvent) {
|
|||||||
return
|
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 {
|
if event.Broadcast.ChannelId == b.debuggingChannel.Id {
|
||||||
b.HandleMsgFromDebuggingChannel(event)
|
b.HandleMsgFromDebuggingChannel(event)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user