Reach it from your phone
The gateway
Your bots live on your laptop. To reach them from your phone, Hermes runs a gateway: a program that stays on in the background, connects to a messaging app like Telegram, passes your messages to the bot, and sends its replies back.
phone → Telegram → gateway → bot → back to your phone
Telegram is free and easy for bots, so we use it here. The gateway also speaks WhatsApp, Slack, Discord and more.
First, Telegram needs a bot account.
Make a Telegram bot
In Telegram, chat with @BotFather, Telegram's own bot for making bots. Send /newbot, choose a name, and a username ending in bot. It gives you a token: the password the gateway uses to speak as that bot. Each of your bots needs its own.
one Hermes bot → one Telegram bot → one token
Anyone with the token can control your bot. If it ever leaks, send /revoke to BotFather for a new one.
Now: who is allowed to talk to it?
Only your people
Anyone can find a Telegram bot. So Hermes answers only the people on a list: TELEGRAM_ALLOWED_USERS, in the bot's .env. The list holds numeric user IDs (your username can change; the number can't). Message @userinfobot to get yours. With no list at all, Hermes answers no one.
allowed users = numeric IDs · everyone else is ignored
The bot and the list are ready. Switch it on.
Start the gateway
Each bot runs its own gateway, with its own token. First, gateway setup asks for the token and the allowed IDs, and saves them in the bot's .env. Then test it in the open terminal. When it works, install it as a service: a program your laptop starts by itself, even after a restart.
setup → test → install as a service
marketing gateway setup
Choose Telegram, paste Marketing's token, type the allowed IDs.
marketing gateway
Message the bot from your phone. If it replies, it works. Press Ctrl+C to stop.
marketing gateway install
marketing gateway status
Now it starts by itself, even after a restart. status shows whether it's running.
Checked against Hermes Agent v0.23 (November 2026). See the Telegram docs if a step looks different.
Count it on new numbers.
✏️ Practice 9.1
Remember:
one Hermes bot → one Telegram bot → one token
allowed users = numeric IDs · everyone else is ignored
Each bot runs its own gateway.
TELEGRAM_ALLOWED_USERS?Four bots in four chats? One group is better.
The team in one group
Make a Telegram group, say “Amal Designers HQ”, add your people and all four bots. Then, in each bot's config.yaml, set two things: require_mention: true (answer only when tagged) and exclusive_bot_mentions: true (stay quiet when another bot is tagged). Without them, bots can chat to each other all night.
in a group: require_mention + exclusive_bot_mentions
# in each bot's config.yaml
telegram:
require_mention: true
exclusive_bot_mentions: true
And when it doesn't answer at all?
When it goes wrong
Most Telegram problems are a token, the allowed list, or the gateway not running. gateway status and the gateway's log tell you which.
Quick check: did it all make sense?
Lesson 9 test
5 questions, one for each idea in this lesson. Answer them all right to pass. A wrong answer tells you why, and which page to look at again.
TELEGRAM_ALLOWED_USERS empty. Who can use the bot?What's next.
Only when asked
Your team now answers from anywhere, but only when someone writes first. Tick what you've really done:
The social media manager needs today's post idea at 9 AM. Do I have to wait to be asked every day?