mirror of https://github.com/velour/catbase.git
Filter out messages from bots for now
This commit is contained in:
parent
695c749727
commit
4ecbe971ac
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue