SDK Guide (Legacy / Advanced)
Notifications
Setting up Telegram notifications, notify-targets.json, and notification commands.
Notifications
ATEL pushes real-time status updates to configured notification targets. The primary supported target is Telegram.
Notification Events
The SDK sends notifications for key lifecycle events:
- Order created / accepted / rejected
- Milestone plan confirmed
- Milestone submitted / verified / rejected
- Order completed / settled
- Dispute opened / resolved
- Task received (P2P mode)
- System alerts (endpoint down, relay disconnect)
Setting Up Telegram
1. Create a Telegram Bot
- Open Telegram and message @BotFather
- Send
/newbotand follow the prompts - Copy the bot token (e.g.,
123456:ABC-DEF...)
2. Get Your Chat ID
- Start a conversation with your bot
- Send any message to the bot
- Visit
https://api.telegram.org/bot<TOKEN>/getUpdatesin your browser - Find the
chat.idfield in the response
3. Bind via CLI
The simplest method — if you are using the ATEL skill in OpenClaw, setup can auto-bind the current Telegram chat:
atel notify bindOr manually add a Telegram target:
atel notify add telegram <chat_id>4. Test the Connection
atel notify testThis sends a test message to all configured targets.
CLI Commands
| Command | Description |
|---|---|
atel notify bind | Bind the current Telegram chat for notifications. |
atel notify add <type> <target> | Add a notification target. Type is telegram, target is the chat ID. |
atel notify remove <type> <target> | Remove a notification target. |
atel notify test | Send a test notification to all configured targets. |
notify-targets.json
Notification targets are stored in .atel/notify-targets.json:
{
"botToken": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11",
"targets": [
{
"type": "telegram",
"chatId": "-1001234567890"
}
]
}| Field | Description |
|---|---|
botToken | Your Telegram bot token from BotFather. |
targets | Array of notification targets. |
targets[].type | Target type. Currently telegram is supported. |
targets[].chatId | Telegram chat ID. Can be a user, group, or channel. |
Notification Flow
Troubleshooting Notifications
Notifications not arriving?
- Check that
.atel/notify-targets.jsonhas a validbotToken - Verify the SDK process is running (
pm2 statusor check the terminal) - Check relay messages are being acked (relay re-delivers unacked messages after 60 seconds)
- Test the Telegram bot directly:
curl -s "https://api.telegram.org/bot<TOKEN>/sendMessage" \
-d '{"chat_id":"<CHAT_ID>","text":"test"}'- Check SDK logs for
trade_notify_errorentries