E2 · The Telegram bot
10 minCreate the bot in @BotFather with /newbot and save the token in the project's .env file.
Done when: you have the token, and it does not appear in any file besides .env (the search in the third block finds nothing).
Lesson 3 · 15 min
Telegram is the simplest gate: you create the bot in two minutes and get a token. That token is the key to the gate. Whoever has the token controls the bot, and anyone can message a bot. That's why this lesson is half creation and half protection.
Start lesson
Goal: create the bot with @BotFather, store the token only in .env, and set the assistant to respond only to you.
Click each block.
INTELECTO was designed for one user. A Jarvis with access to your machine is powerful, and that’s exactly why it deserves care.
Click each step.
On Telegram, search for @BotFather (the official one, with a verified badge) and send /newbot.
Choose the name shown in the conversation and the @username, which must end in bot. It will reply with the token.
Use the name from your meu-jarvis.md. The @username can be the name + _bot.
Paste the token on a line in the project folder’s .env, as you learned in step 1.
Check that .env is in .gitignore. Bots find exposed keys on GitHub quickly.
The token doesn’t appear in any file other than .env.
When you build it (lesson 4), ask the agent to have the bot reply only to your Telegram user and ignore everyone else.
In the vault (lesson 7), you’ll see why this matters even more when the assistant runs commands.
The bot replies only to my Telegram user; messages from other people are ignored and logged.
A token in a screenshot, group, or commit has leaked. Don’t delete it and hope for the best: generate a new one in @BotFather and replace it in .env.
The old token stops working, and whoever got it loses access.
/mybots → choose the bot → API Token → generate a new one.
Replace the text between < > with your token. Never paste the token here in the course or in a chat.
TELEGRAM_BOT_TOKEN=<paste the token from @BotFather here>
grep -n ".env" .gitignore git status --short
grep -rn "<the first 6 characters of the token>" . --exclude=.env
grep shows the .env line in .gitignore.
git status does not list .env.
The search for the start of the token finds nothing outside .env.
If git status shows ?? .env, the line is missing from .gitignore: add it before any commit.
If the search finds the token in another file, delete it there and generate a new token in @BotFather.
Exercise E2 in sequence 2.
Create the bot in @BotFather with /newbot and save the token in the project's .env file.
Done when: you have the token, and it does not appear in any file besides .env (the search in the third block finds nothing).
In your meu-jarvis.md, add the rule: it only responds to me on Telegram.
Done when: the rule is written down and will go with the build request in lesson 4.
The explanation appears after your answer.
Question 1 of 3
Where can the bot token appear?competency
Question 2 of 3
Why does the bot need a list of people who can talk to it?
Question 3 of 3
Your token appeared in a screenshot you posted. What should you do?
Choose an option. The explanation appears after your attempt.