]> git.giacomolli.uk - onechat/blobdiff - chat.go
Call sendRichMessage of the Bot API
[onechat] / chat.go
diff --git a/chat.go b/chat.go
index 8bc5285163488df1b67a53e377ceba6720eed8b2..1e96b2458be159bdd8fe624f35c0af4668cb6dbc 100644 (file)
--- a/chat.go
+++ b/chat.go
@@ -143,12 +143,19 @@ func showEvents(conn net.Conn, out io.Writer) error {
 }
 
 // eventText returns the text that the client shows for event, or "" for none.
 }
 
 // eventText returns the text that the client shows for event, or "" for none.
-// The client shows no user message, because the user typed it. A tool result
-// shows its first resultLines lines.
+// The client shows a user message only from another source, such as telegram,
+// because the user typed the others. A tool result shows its first resultLines
+// lines.
 func eventText(event Event) string {
        switch event.Kind {
        case "ready":
                return "[connected to " + event.Text + "]"
 func eventText(event Event) string {
        switch event.Kind {
        case "ready":
                return "[connected to " + event.Text + "]"
+       case "user":
+               if event.Source == terminalSource {
+                       return ""
+               }
+
+               return "[" + event.Source + "] " + event.Text
        case "reply":
                return event.Text
        case "tool":
        case "reply":
                return event.Text
        case "tool":