Fix gateway skills: minor cleanup in matrix/signal/telegram org blocks
This commit is contained in:
@@ -32,8 +32,8 @@ Enable mobile/remote access to the OpenCortex via a secure Telegram bot.
|
||||
The gateway operates as an autonomous background service. It uses `dexador` for HTTP polling and `cl-json` for payload processing. Authentication is enforced via a whitelist of authorized `chat_id`s.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
- `(:sensor :chat-message :channel :telegram ...)`
|
||||
- `(:type :REQUEST :target :telegram :chat-id "..." :text "...")`
|
||||
- `(:type :EVENT :meta (:source :telegram :chat-id "...") :payload (:sensor :user-input :text "..."))`
|
||||
- `(:type :REQUEST :target :telegram :payload (:action :message :text "..."))`
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
@@ -76,7 +76,8 @@ Fetches the Bot API token from the secure vault.
|
||||
"Sends a message back to Telegram."
|
||||
(declare (ignore context))
|
||||
(let* ((payload (getf action :payload))
|
||||
(chat-id (or (getf payload :chat-id) (getf action :chat-id)))
|
||||
(meta (getf action :meta))
|
||||
(chat-id (or (getf meta :chat-id) (getf payload :chat-id) (getf action :chat-id)))
|
||||
(text (or (getf payload :text) (getf action :text)))
|
||||
(token (get-telegram-token))
|
||||
(url (format nil "https://api.telegram.org/bot~a/sendMessage" token)))
|
||||
@@ -113,9 +114,8 @@ Fetches the Bot API token from the secure vault.
|
||||
(harness-log "TELEGRAM: Received message from ~a" chat-id)
|
||||
(inject-stimulus
|
||||
(list :type :EVENT
|
||||
:payload (list :sensor :chat-message
|
||||
:channel :telegram
|
||||
:chat-id (format nil "~a" chat-id)
|
||||
:meta (list :source :telegram :chat-id (format nil "~a" chat-id))
|
||||
:payload (list :sensor :user-input
|
||||
:text text)))))))
|
||||
(error (c) (harness-log "TELEGRAM POLL ERROR: ~a" c))))))
|
||||
#+end_src
|
||||
|
||||
Reference in New Issue
Block a user