Your Jarvis|INEMA.CLUB-PRO

Lesson 3 · 15 min

The gate: the Telegram bot, with one owner

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
Hands holding a phone with a messaging app open to a conversation.

In this lesson, you will

  1. 1Create the bot with /newbot in @BotFather
  2. 2Why the token stays only in .env and out of Git
  3. 3How the channel talks to Telegram (long polling)
  4. 4Why the bot should accept messages only from its owner

Goal: create the bot with @BotFather, store the token only in .env, and set the assistant to respond only to you.

01From @BotFather to your bot

Click each block.

Click each block in the diagram to see what it does.

INTELECTO was designed for one user. A Jarvis with access to your machine is powerful, and that’s exactly why it deserves care.

02Create and protect it, step by step

Click each step.

1. Create the bot

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.

NameUse the name from your meu-jarvis.md. The @username can be the name + _bot.

03The .env and the check

Replace the text between < > with your token. Never paste the token here in the course or in a chat.

.env (in the project folder)
TELEGRAM_BOT_TOKEN=<paste the token from @BotFather here>
Terminal · check that .env does not get pushed
grep -n ".env" .gitignore
git status --short
Terminal · look for the token outside .env
grep -rn "<the first 6 characters of the token>" . --exclude=.env
Simulation: illustrative example

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.

04Practice: the Telegram bot

Exercise E2 in sequence 2.

E2 · The Telegram bot

10 min

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).

E2b · Write down the sole owner's request

5 min

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.

05Test what you learned

The explanation appears after your answer.

Question 1 of 3

Where can the bot token appear?competency

Go further

Previous lessonNext lesson