Telegram Notifications

Botmarley can send trade notifications to your Telegram account, keeping you informed of trading actions even when you're away from the dashboard.

Setup

1. Create a Telegram Bot

  1. Open Telegram and search for @BotFather
  2. Send /newbot and follow the prompts
  3. Choose a name (e.g., "My Botmarley Alerts")
  4. Copy the bot token (looks like 123456789:ABCdefGHI...)

2. Get Your Username

Your Telegram username (the one starting with @) is used for access control. Only messages from this username will be accepted by the bot.

3. Configure in Botmarley

Navigate to Settings (/settings) and fill in:

FieldValue
EnabledCheck the box
Bot TokenPaste the token from BotFather
Allowed UsernameYour Telegram username (without @)

Click Save.

4. Start the Bot

Open a chat with your new bot in Telegram and send /start. The bot needs this initial message to establish the chat.

What Gets Notified

The Telegram bot sends notifications for trade actions during live trading sessions:

EventExample Message
Buy"BUY 0.001 BTC @ $67,500.00 (Session: BTC Scalper)"
Sell"SELL 0.001 BTC @ $69,200.00 — PnL: +$1.70 (+2.5%)"
Session Started"Trading session 'BTC Scalper' started on XBTUSDT"
Session Stopped"Session 'BTC Scalper' stopped — Total PnL: +$45.20"

Tip

Notifications are sent in real-time as actions execute. They use the same broadcast channel as the web interface's SSE updates.

Architecture

graph LR
    E[Trading Engine] -->|ActionNotification| B[Broadcast Channel]
    B --> T[Telegram Bot]
    B --> S[SSE Stream]
    T --> TG[Telegram API]
    S --> W[Web Browser]

The Telegram bot subscribes to the same ActionNotification broadcast channel that powers the web interface's real-time updates.

Troubleshooting

Bot Not Sending Messages

  1. Check Settings — verify the bot token and username are correct
  2. Send /start — you must initiate the chat first
  3. Check Logs — look for Telegram errors in the Activity Logs or terminal output
  4. Restart Server — the Telegram bot spawns at startup; changes require a restart

Bot Token Invalid

If you see "Telegram bot failed to start" in the logs:

  • Verify the token with BotFather
  • Make sure you copied the full token including the colon

Warning

Keep your bot token secret. Anyone with the token can control your bot. If compromised, use BotFather's /revoke command to generate a new token.