X-Hub Telegram Bot: Alerts and Buttons
Ask AI
Ready taskDo it with me, step by step
Chat assistants
Open in ChatGPTNew tabOpen in ClaudeNew tabCoding agents
Claude CodeOpens the desktop appCodexOpens the desktop appCursorOpens the app from the webCopy
View as MarkdownPlain text for AI toolsSee the prompt
Read https://xproxy.io/document/xproxy-hub-telegram.md, the XProxy guide "X-Hub Telegram Bot: Alerts and Buttons". If you cannot open links, download them with curl. Then take me through it one step at a time: tell me exactly what to click or type, wait until I say it is done, and help me when what I see is different from the guide. Start by asking what I have (hardware, XProxy version, what I see now). Other XProxy guides, each with a Markdown copy at its URL + .md, are listed in https://xproxy.io/llms.txt.
The app opens with the prompt filled in. Nothing runs until you press Enter.
Get a Telegram message when a box goes offline or a modem stops working, and fix it with a button. You create the bot yourself in two minutes.
You need: a running X-Hub, a Telegram account, and an owner login to set the bot up. Works on X-Hub on your box and on a VPS. X-Hub needs internet access to Telegram.
How do I set up the Telegram bot?
Step 1 of 6
In Telegram, open @BotFather 1. Send /newbot and answer two questions: a name for your bot, and a username that ends in bot.
BotFather replies with a token, a long text like 123456789:AAH.... Copy it. Keep it private: anyone with the token controls the bot.
What alerts do I get?
| Alert | When |
|---|---|
| Server is offline | A box has been gone for 1 minute. |
| Modem is offline | A modem has been disconnected for 90 seconds. |
| Modem stuck rotating | A rotation has taken more than 5 minutes. |
- One message per problem. It is edited in place: when someone acknowledges it, it says who; when it is fixed, it is crossed out and says how long it took.
- Four or more new problems on one server arrive as one grouped message with an Acknowledge all button.
- While a server is offline, the problems of its own modems are put on hold.
What do the buttons do?
| Button | Where | What it does |
|---|---|---|
| Acknowledge | Alerts | Marks the problem as handled. |
| Rotate IP | Modem alerts and cards | Gets a new public IP. |
| Modem actions | Modem alerts | Opens the modem card. |
| Reboot modem, Reset USB | Modem card | Power-cycles the modem or its USB port. Asks Yes or Cancel first. |
| Diagnose | Modem card | Runs the health checks and names the first thing that fails. |
| VPS doctor | Server card | Checks the VPS forwarding of that server. |
| Reboot server | Server card, owners only | Reboots the whole box. A risky change, see Passkeys. |
Every button checks the X-Hub role of the person who pressed it, not the chat. In a group, a viewer pressing Rotate IP gets a refusal, even if an operator linked the group. A Free box refuses rotation and reboots, like its own panel.
Which commands can I send?
| Command | What it does |
|---|---|
/status | Servers online, modems up, open problems. |
/incidents | Open problems, with Acknowledge buttons for operators. |
/servers | Every server with its modems. |
/server Office box | One server: health, modems, VPS doctor, and for owners Reboot server. Type the server name. |
/find 10003 | Find a proxy by IP, port, label, IMEI or server name, then act on it. |
/mute 60 | Mute new alerts in this chat for 60 minutes (up to a week). Operators and owners. Existing alerts still update. |
/unmute | Alerts on again. |
/allow 4 | Owners: after one passkey approval, risky changes run without asking for 4 hours (1 to 24). |
/stop | Owners: end that time window now. |
/unlink | Unlink your Telegram from X-Hub. |
/help | What the bot can do for your role. |
Can I see what people sent the bot?
Owners can. At the bottom of the Telegram page, Chat history lists commands, button presses and the bot replies for 30 days. Search by chat, kind, text or time, delete one chat or everything, and use the Record switch to stop recording. Link codes are hidden. In groups, the bot only sees commands, not other messages.
FAQ
Telegram is blocked in my country
X-Hub needs to reach api.telegram.org. Where that is blocked, start X-Hub with -telegram-api https://your-relay (or XPROXY_HUB_TELEGRAM_API) pointing at a Bot API relay or your own Bot API server. This is a start option of the X-Hub program, so it fits X-Hub on a VPS. For X-Hub on a box, ask support. The page shows the address in use under Bot setup.
I linked my account but get no alerts
Check Alert chats: the chat must say On, not Muted. Alerts only start for problems that open after you linked; send /incidents to see the open ones. Make sure the bot is still Connected.
I want to use another bot
Paste the new token over the old one and click Save. Linked chats and accounts are kept. Turn off stops alerts and keeps the links, so alerts resume when you add a token again.
Why can my colleague not press the buttons?
Their X-Hub account is a viewer. An owner can change the role in Users and API keys.
What next?
Send the same alerts to Slack or your own tools, or let an AI assistant help.

