Matrix
SwB 透過 Matrix 機器人帳號收發文字訊息。回覆會回到原本的聊天室或討論串。在群組聊天室中標註機器人,就能傳訊息給它。
建立 SwB 要用的聊天室時,關閉聊天室加密。機器人只接受 SwB 指定的擁有者帳號發出的邀請。
模組設定
在 SwB 中,將共用設定的 Matrix 聊天室放在同一組。Matrix 使用者 ID 的格式如 @alex:matrix.example.org。聊天室 ID 的格式如 !team:matrix.example.org。
| 鍵 | 用途 |
|---|---|
blocks.matrix | Matrix 連線設定 |
blocks.matrix.use | 設為 matrix |
blocks.matrix.enabled | 設為 true 即可載入模組 |
blocks.matrix.homeserver | 代管機器人帳號的伺服器 HTTPS 網址 |
blocks.matrix.token_env | 存取權杖的環境變數名稱 |
blocks.matrix.project | 接收 Matrix 訊息的 SwB 專案 |
blocks.matrix.default_target | 預設代理位址,例如 agent:claude |
blocks.matrix.agents | 各代理可發文和接收事件的群組 |
blocks.matrix.spaces | 共用設定的聊天室群組 |
blocks.matrix.spaces.*.rooms | 群組內的 Matrix 聊天室 ID |
blocks.matrix.spaces.*.owner_ids | SwB 視為擁有者的 Matrix 使用者 ID |
blocks.matrix.spaces.*.known | 已知使用者的 Matrix 使用者 ID 和名稱 |
blocks.matrix.spaces.*.project | 此群組使用的專案 |
blocks.matrix.spaces.*.default_target | 此群組的預設代理位址 |