oclaw/openclaw/docs/channels/location.md
oliver dbbe3add6a 重构主控编排与运行时预热链路,统一工作区提示词/专家调度协议并补齐 wiki 记忆注入与写回闭环。
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。

Made-with: Cursor
2026-04-26 08:34:33 +08:00

1.7 KiB

summary read_when title
Inbound channel location parsing (Telegram/WhatsApp/Matrix) and context fields
Adding or modifying channel location parsing
Using location context fields in agent prompts or tools
Channel Location Parsing

Channel location parsing

OpenClaw normalizes shared locations from chat channels into:

  • human-readable text appended to the inbound body, and
  • structured fields in the auto-reply context payload.

Currently supported:

  • Telegram (location pins + venues + live locations)
  • WhatsApp (locationMessage + liveLocationMessage)
  • Matrix (m.location with geo_uri)

Text formatting

Locations are rendered as friendly lines without brackets:

  • Pin:
    • 📍 48.858844, 2.294351 ±12m
  • Named place:
    • 📍 Eiffel Tower — Champ de Mars, Paris (48.858844, 2.294351 ±12m)
  • Live share:
    • 🛰 Live location: 48.858844, 2.294351 ±12m

If the channel includes a caption/comment, it is appended on the next line:

📍 48.858844, 2.294351 ±12m
Meet here

Context fields

When a location is present, these fields are added to ctx:

  • LocationLat (number)
  • LocationLon (number)
  • LocationAccuracy (number, meters; optional)
  • LocationName (string; optional)
  • LocationAddress (string; optional)
  • LocationSource (pin | place | live)
  • LocationIsLive (boolean)

Channel notes

  • Telegram: venues map to LocationName/LocationAddress; live locations use live_period.
  • WhatsApp: locationMessage.comment and liveLocationMessage.caption are appended as the caption line.
  • Matrix: geo_uri is parsed as a pin location; altitude is ignored and LocationIsLive is always false.