Market Cap: $2.1842T -1.57%
Volume(24h): $139.9504B 8.29%
Fear & Greed Index:

16 - Extreme Fear

  • Market Cap: $2.1842T -1.57%
  • Volume(24h): $139.9504B 8.29%
  • Fear & Greed Index:
  • Market Cap: $2.1842T -1.57%
Cryptos
Topics
Cryptospedia
News
CryptosTopics
Videos
Top Cryptospedia

Select Language

Select Language

Select Currency

Cryptos
Topics
Cryptospedia
News
CryptosTopics
Videos

How to set up mining alerts on Telegram? (Bot Configuration)

Create a Telegram bot via BotFather, secure its API token, connect it to your miner using cURL/Python alerts, format messages with emojis and HTML, and restrict access via chat ID whitelisting.

Mar 06, 2026 at 07:19 pm

Creating a Telegram Bot for Mining Notifications

1. Visit the BotFather account on Telegram and send the command /newbot to initiate bot creation.

  1. Provide a name and username for your bot; the username must end with bot, such as miningalertbot.
  2. After confirmation, BotFather returns an API token — this is essential for integrating with mining software or scripts.
  3. Store the token securely; it grants full control over your bot’s messaging capabilities and cannot be retrieved again if lost.
  4. Verify the bot is active by sending it a message like /start — it should respond if correctly registered.

Connecting the Bot to Your Mining Rig

1. Identify your mining software: common platforms include PhoenixMiner, T-Rex, and GMiner, each supporting custom notification hooks.

  1. Locate the configuration file (e.g., miner.conf or start.bat) used to launch your miner.
  2. Add a script trigger that executes on specific events — such as hash rate drops below 90% of baseline, pool disconnects, or GPU temperature exceeding 85°C.
  3. Use cURL or Python-based HTTP POST requests to send formatted messages to Telegram’s API endpoint: https://api.telegram.org/bot{YOUR_TOKEN}/sendMessage.
  4. Include the chat ID in the payload — obtain it by messaging your bot and checking https://api.telegram.org/bot{YOUR_TOKEN}/getUpdates.

Formatting Alert Messages Effectively

1. Structure alerts with clear identifiers: include rig name, timestamp, GPU model, current hashrate, and deviation percentage.

  1. Use Unicode symbols like ⚠️ for warnings, 📈 for performance spikes, and ❌ for failures to improve visual scanning.
  2. Limit message length to under 4096 characters — longer payloads require splitting or truncation logic.
  3. Encode special characters properly using URL encoding — spaces become %20, newlines become %0A.
  4. Apply bold formatting selectively via parse_mode=HTML and wrap critical values like Hashrate: 87.3 MH/s.

Securing Bot Communication and Access

1. Restrict bot access to only authorized chat IDs — ignore messages from unknown users by validating incoming chat_id against a whitelist.

  1. Avoid embedding the API token directly in shell scripts exposed to system logs or version control repositories.
  2. Rotate tokens periodically using BotFather’s /revoke command if suspicious activity is detected.
  3. Disable inline mode and group permissions unless explicitly needed — bots in groups can be abused for spam or phishing.
  4. Monitor bot usage through Telegram’s Bot Analytics dashboard, accessible via BotFather’s /stats command.

Frequently Asked Questions

Q: Can I receive alerts without running a local script?A: Yes — some mining pools like 2Miners and F2Pool offer native Telegram alert integrations via dashboard settings. Enable them by linking your bot token and specifying wallet addresses.

Q: Why does my bot not respond to /start but accepts API messages?A: Telegram bots do not auto-reply to commands unless programmed to do so. The /start message appears in getUpdates output but requires a backend service to process and reply.

Q: Is it safe to expose my bot token inside a Docker container?A: Not inherently — containers may leak environment variables via logs or inspection. Pass tokens via Docker secrets or mount them as read-only files instead of injecting them as plaintext ENV vars.

Q: Can I send screenshots of mining dashboards via Telegram bot?A: Yes — use tools like scrot or ffmpeg to capture terminal output or web UIs, then upload images via sendPhoto endpoint with multipart/form-data encoding.

Disclaimer:info@kdj.com

The information provided is not trading advice. kdj.com does not assume any responsibility for any investments made based on the information provided in this article. Cryptocurrencies are highly volatile and it is highly recommended that you invest with caution after thorough research!

If you believe that the content used on this website infringes your copyright, please contact us immediately (info@kdj.com) and we will delete it promptly.

Related knowledge

See all articles

User not found or password invalid

Your input is correct