add prettyprinting to figure out what's in the structur
This commit is contained in:
parent
0d75d4a5ac
commit
cb1bdab0af
@ -1,6 +1,6 @@
|
|||||||
package bot
|
package bot
|
||||||
|
|
||||||
//import "github.com/kr/pretty"
|
import "github.com/kr/pretty"
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/mattermost/mattermost-server/v5/model"
|
"github.com/mattermost/mattermost-server/v5/model"
|
||||||
@ -247,7 +247,6 @@ func (b *Bot) HandleMsgFromChannel(event *model.WebSocketEvent) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//pretty.Print(post)
|
|
||||||
if matched, _ := regexp.MatchString(`(?:^|\W)metar(?:$|\W)`, post.Message); matched {
|
if matched, _ := regexp.MatchString(`(?:^|\W)metar(?:$|\W)`, post.Message); matched {
|
||||||
b.HandleWeatherRequest(post.ChannelId, post.Id, post.Message)
|
b.HandleWeatherRequest(post.ChannelId, post.Id, post.Message)
|
||||||
return
|
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,
|
// FIXME check and see if the message from mm is a bot message, if so,
|
||||||
// ignore it
|
// ignore it
|
||||||
|
pretty.Print(post)
|
||||||
|
|
||||||
if matched, _ := regexp.MatchString(`(?:^|\W)shutdown(?:$|\W)`, post.Message); matched {
|
if matched, _ := regexp.MatchString(`(?:^|\W)shutdown(?:$|\W)`, post.Message); matched {
|
||||||
b.Shutdown()
|
b.Shutdown()
|
||||||
|
Loading…
Reference in New Issue
Block a user