X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/3aa065806f87d0876fbd7b05e5ded4aad380cc73..d7bc0a6ac452bfc646610fdfd7c8eccb5c55218f:/telegram.go diff --git a/telegram.go b/telegram.go index 306f8f5..a024e82 100644 --- a/telegram.go +++ b/telegram.go @@ -264,7 +264,7 @@ func (b *TelegramBot) send(ctx context.Context) { func (b *TelegramBot) poll(ctx context.Context, l *TurnLoop, whatsapp *WhatsApp) error { offset, err := telegramLoadOffset(b.offsetPath) if err != nil { - return err + return fmt.Errorf("load Telegram offset: %w", err) } outage := &TelegramOutage{ @@ -313,7 +313,7 @@ poll: continue poll } - return err + return fmt.Errorf("handle Telegram update: %w", err) } imageOutage.End() @@ -323,7 +323,7 @@ poll: offset = update.UpdateID + 1 err = telegramSaveOffset(b.offsetPath, offset) if err != nil { - return err + return fmt.Errorf("save Telegram offset: %w", err) } } } @@ -476,7 +476,7 @@ func (b *TelegramBot) handle(ctx context.Context, l *TurnLoop, whatsapp *WhatsAp default: _, err := l.Submit(telegramSource, message.Text) if err != nil { - return err + return fmt.Errorf("submit Telegram text: %w", err) } err = l.Flush(context.WithoutCancel(ctx)) @@ -591,7 +591,7 @@ 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":