Filter out messages from bots for now

This commit is contained in:
skkiesel 2017-11-09 06:21:43 -05:00
parent 695c749727
commit 4ecbe971ac
1 changed files with 6 additions and 5 deletions

View File

@ -134,6 +134,7 @@ type slackMessage struct {
Text string `json:"text"`
User string `json:"user"`
Username string `json:"username"`
BotId string `json:"bot_id"`
Ts string `json:"ts"`
ThreadTs string `json:"thread_ts"`
Error struct {
@ -392,7 +393,7 @@ func (s *Slack) Serve() error {
}
switch msg.Type {
case "message":
if !msg.Hidden && msg.ThreadTs == "" {
if msg.BotId == "" && !msg.Hidden && msg.ThreadTs == "" {
m := s.buildMessage(msg)
if m.Time.Before(s.lastRecieved) {
log.Printf("Ignoring message: %+v\nlastRecieved: %v msg: %v", msg.ID, s.lastRecieved, m.Time)