add prettyprinting to figure out what's in the structur
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing

This commit is contained in:
Jeffrey Paul 2020-09-08 21:00:37 -07:00
parent 0d75d4a5ac
commit cb1bdab0af

View File

@ -1,6 +1,6 @@
package bot
//import "github.com/kr/pretty"
import "github.com/kr/pretty"
import (
"fmt"
"github.com/mattermost/mattermost-server/v5/model"
@ -247,7 +247,6 @@ func (b *Bot) HandleMsgFromChannel(event *model.WebSocketEvent) {
return
}
//pretty.Print(post)
if matched, _ := regexp.MatchString(`(?:^|\W)metar(?:$|\W)`, post.Message); matched {
b.HandleWeatherRequest(post.ChannelId, post.Id, post.Message)
return
@ -288,6 +287,7 @@ func (b *Bot) HandleMsgFromDebuggingChannel(event *model.WebSocketEvent) {
// FIXME check and see if the message from mm is a bot message, if so,
// ignore it
pretty.Print(post)
if matched, _ := regexp.MatchString(`(?:^|\W)shutdown(?:$|\W)`, post.Message); matched {
b.Shutdown()