StockLobster
Use this skill to wire StockLobster alerts into OpenClaw through the hooks gateway and deliver them to Telegram or another supported outbound channel.
Confirmed payload shape
Read references/payload-format.md for the confirmed payload schema and examples.
Recommended OpenClaw hook mapping
Use an agent mapping, not wake, when the goal is direct Telegram delivery.
Sanitized example:
CODEBLOCK0
Setup
- 1. Enable hooks in
~/.openclaw/openclaw.json. - Set a dedicated hooks token, not the shared gateway token.
- Use hook path
/hooks and mapping path /stocklobster so the endpoint becomes:
-
http://<HOST>:18789/hooks/stocklobster
- 4. Use
messageTemplate, not textTemplate, because this flow should use action: "agent" for channel delivery. - Reference incoming webhook fields through
payload, for example {{payload.text}}. - Set:
-
deliver: true
-
channel: "telegram"
-
to: "<TELEGRAM_CHAT_ID>"
- 7. Restart the gateway after config changes:
CODEBLOCK1
Testing with curl
CODEBLOCK2
Expected response:
CODEBLOCK3
If you only want to wake a session and not push to Telegram immediately, use action: "wake" with textTemplate, but that is a different flow.
Troubleshooting
- For
wake, the rendered
textTemplate was empty.
- For
agent, the rendered
messageTemplate was empty.
- In this OpenClaw build, templates resolve against
payload, not
json.
- - Hook accepted but no Telegram message arrived
- Check that the mapping uses
action: "agent".
- Check
deliver: true.
- Check
channel and
to are set explicitly.
- Restart the gateway after editing config.
- - Hook returns INLINECODE28
- That indicates a wake event, not necessarily an outbound Telegram delivery.
- - Hook returns INLINECODE29
- That indicates an agent run was created for delivery-capable handling.
StockLobster
使用此技能通过钩子网关将StockLobster警报接入OpenClaw,并将其发送到Telegram或其他支持的出站通道。
确认的负载格式
请阅读 references/payload-format.md 以获取确认的负载模式和示例。
推荐的OpenClaw钩子映射
当目标是直接发送到Telegram时,使用 agent 映射,而不是 wake。
清理后的示例:
json
{
hooks: {
enabled: true,
path: /hooks,
token: ,
mappings: [
{
id: stocklobster-ingest,
name: StockLobster ingest,
match: {
path: /stocklobster,
method: POST
},
action: agent,
wakeMode: now,
agentId: main,
sessionKey: hook:stocklobster,
messageTemplate: {{payload.text}},
deliver: true,
channel: telegram,
to: CHATID>
}
]
}
}
设置步骤
- 1. 在 ~/.openclaw/openclaw.json 中启用钩子。
- 设置专用的钩子令牌,而不是共享的网关令牌。
- 使用钩子路径 /hooks 和映射路径 /stocklobster,使端点变为:
- http://
:18789/hooks/stocklobster
- 4. 使用 messageTemplate,而不是 textTemplate,因为此流程应使用 action: agent 进行通道投递。
- 通过 payload 引用传入的webhook字段,例如 {{payload.text}}。
- 设置:
- deliver: true
- channel: telegram
- to: CHATID>
- 7. 配置更改后重启网关:
bash
openclaw gateway restart
使用curl进行测试
bash
curl -X POST http://:18789/hooks/stocklobster \
-H Authorization: Bearer \
-H Content-Type: application/json \
-d {text:StockLobster alert\nSymbol: TEST\nEvent: screen_hit\nMessage: TEST hit momentum criteria\nPrice: 4.92\nChange: 3.4%\nVolume: 1234567\nStrategy: momentum\nTimestamp: 2026-04-08T02:21:00.000Z}
预期响应:
json
{ok:true,runId:}
如果只想唤醒会话而不立即推送到Telegram,请使用带有 textTemplate 的 action: wake,但这是不同的流程。
故障排除
- - hook mapping requires text
- 对于 wake,渲染的 textTemplate 为空。
- 对于 agent,渲染的 messageTemplate 为空。
- 在此OpenClaw版本中,模板针对 payload 而非 json 进行解析。
- 检查映射是否使用 action: agent。
- 检查 deliver: true。
- 检查 channel 和 to 是否已明确设置。
- 编辑配置后重启网关。
- - 钩子返回 {ok:true,mode:now}
- 这表示一个唤醒事件,不一定表示出站Telegram投递。
- - 钩子返回 {ok:true,runId:...}
- 这表示已创建一个代理运行以进行可投递的处理。