X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/ec230eee6b06580031637bc97c99ec6db7b41926..3f61d7080bc1cb14988a65ac433cbc5959857c16:/telegram.go?ds=inline diff --git a/telegram.go b/telegram.go index 16eff80..e77ea69 100644 --- a/telegram.go +++ b/telegram.go @@ -160,10 +160,15 @@ type TelegramBot struct { } // Notify queues event for the chat. It never blocks, so a slow network does not -// stop the agent. +// 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. func (b *TelegramBot) Notify(event Event) { switch event.Kind { - case "busy", "idle", "reply", "error", "notice", "subagent", "work": + case "busy", "idle", "reply", "error", "notice", "subagent": + case "work": + if event.Source == whatsappSource || event.Source == scheduleSource { + return + } case "user": if event.Source == telegramSource { return