X-Git-Url: http://git.giacomolli.uk/onechat/blobdiff_plain/47f69638bc96100f2e446f63c7c3689023156e64..cb514b662bcf9d90b2cf02789c989f777d774d3f:/telegram.go?ds=sidebyside diff --git a/telegram.go b/telegram.go index c78080d..c560104 100644 --- a/telegram.go +++ b/telegram.go @@ -163,7 +163,7 @@ type TelegramBot struct { // stop the agent. func (b *TelegramBot) Notify(event Event) { switch event.Kind { - case "busy", "idle", "reply", "error", "notice": + case "busy", "idle", "reply", "error", "notice", "subagent", "work": case "user": if event.Source == telegramSource { return @@ -540,11 +540,17 @@ func telegramSplitMessage(text string, limit int) []string { } // telegramText returns the text of event for the chat. A user message of -// another client has its source as a mark. +// another client has its source as a mark. A subagent shows only its start and +// how its run ended, because the reply of the agent carries the content of the +// report. func telegramText(event Event) string { switch event.Kind { case "user": return "[" + event.Source + "] " + event.Text + case "subagent": + return "[" + event.Text + "] started" + case "work": + return "[" + event.Source + "] " + event.Status case "error": return "Error: " + event.Text default: