X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/bd7da3557dc7a17020931f5a49ed5007fa81a645..42b4acd4ba70d3c12da4513d139717e592eefe4a:/telegram.go diff --git a/telegram.go b/telegram.go index 85b0f44..78a1c7a 100644 --- a/telegram.go +++ b/telegram.go @@ -313,11 +313,7 @@ poll: continue poll } - if err != nil { - return fmt.Errorf("handle Telegram update: %w", err) - } - - return nil + return fmt.Errorf("handle Telegram update: %w", err) } imageOutage.End() @@ -589,13 +585,13 @@ func (b *TelegramBot) sendOutage() *TelegramOutage { } // Notify queues event for the chat. It never blocks, so a slow network does not -// stop the agent. The WhatsApp batches and the runs of the schedules do not go -// to the chat: the reply of the agent tells the user what needs the user. +// stop the agent. External events, WhatsApp batches, and schedule runs do not +// go to the chat: the reply of the agent tells the user what needs the user. func (b *TelegramBot) Notify(event Event) { switch event.Kind { case "busy", "idle", "reply", "error", "notice", "subagent": case "work": - if event.Source == whatsappSource || event.Source == scheduleSource { + if event.Source == whatsappSource || event.Source == scheduleSource || event.Source == notifySource { return } case "user":