Skip to content

Telegram bot

Mirage can write to you in Telegram when something happens on this computer: a profile started or crashed, its proxy failed, a scenario finished, an AI agent waits for your decision. You can decline the agent’s step from the chat and, if you turn it on, allow it.

The bot is yours. You create it in Telegram, and Mirage on your computer talks to Telegram directly. Mirage’s server takes no part and does not see these messages. The bot works while Mirage is open.

Connect a bot

  1. In Telegram, open @BotFather and send /newbot. Give the bot a name and a username.
  2. BotFather answers with a token that looks like 123456789:AA…. Copy it.
  3. In Mirage, open Automation, find Telegram bot, paste the token and click Connect the bot.
  4. Mirage shows a link. Open it where your Telegram is and press Start. The chat appears under Chats that get messages.

The link works for 15 minutes and for one chat. Add a chat makes a new one; up to five chats can be linked. To link a group, add the bot to the group and send /start followed by the code from the end of the link.

The token is stored on this computer, encrypted. Whoever has it controls the bot, so do not share it.

Use a separate bot for each computer. Telegram gives a bot’s messages to one program only, so the same bot on two computers stops working on one of them, and Mirage shows Bot is busy.

What the messages say

By default a message says what happened and nothing else: “A profile started.”, “An agent waits for your decision in Mirage.” Telegram stores everything a bot sends, so names stay on your computer until you decide otherwise.

Show names in messages adds the profile’s name, the reason of a crash or a proxy failure, and for an agent’s step: the agent, the step, the site and why Mirage asks. A screenshot and the full page address are never sent.

Choose which events to send under Events. Send messages pauses everything and keeps the bot and its chats.

Decide an agent’s step from the chat

A message about a waiting step always has a Decline button.

Allow agent steps from Telegram adds an “Allow once” button. It needs Show names in messages: you allow a step by what you see. Three kinds of steps are never allowed from Telegram, whatever the settings: payments, changes of passwords and other credentials, and access grants. For those, open Mirage, where the screenshot is.

When the step is decided, in the chat or in Mirage, the message loses its buttons and says how it ended and who decided. Every decision from a chat is written to the agent journal with the person’s Telegram name.

Anyone in a linked chat can press the buttons. Link a group only if you trust everyone in it.

Stop

  • /stop in a chat unlinks that chat.
  • The bin icon next to a chat in Mirage does the same.
  • Disconnect forgets the token and all chats. The bot itself stays in Telegram; delete it in @BotFather if you no longer need it.

If something is wrong

Mirage shows What it means What to do
Token refused Telegram no longer accepts the token Get a new token in @BotFather (/token), disconnect the bot and connect it again
Bot is busy Another program reads this bot: Mirage on another computer, or a service with a webhook Make a separate bot for this computer
No connection Telegram does not answer from this computer Check the connection; if Telegram is blocked in your network, the bot cannot work there. Events that happen meanwhile are not sent later