Telegram is optional. @BotFather is Telegram’s official account for creating bots; the token is your bot’s secret code, and the ID is your account number. The token stays in the vault; only registered IDs can talk to the bot. The project tests used a local fake server.
3Understand /sim and /nao without promising a live test
Objective: Prepare the token in the vault and set the owner ID so the bot only responds to the authorized person.
01 · Message until the reply
Without a registered owner, the bot only responds to /id.
Click each block in the diagram to see what it does.
Click each part to see what it does.
02 · Turn this on only if you plan to use it
Click each step to see what to do.
1. Create a bot
Open @BotFather in Telegram, send /newbot, choose a name, then choose a username that ends in bot. Copy the token you receive: it’s the bot’s secret code. Don’t paste it into USER.md, AGENTS.md, or config.json. @BotFather also sends your bot’s link in the format t.me/bot_name: open that link to chat with it.
2. Store the secret
The guardar telegram command asks for the token without displaying it. The configuration file stores the IDs, not the token.
3. Find your ID
Turn on the bot, send /id, and write down the number. The actual message says “Put it in telegram_donos in config.json.” You can fill in that same field using configurar, when asked for Telegram IDs. Stop the bot with Ctrl+C before configuring it.
4. Register the owner
Enter the ID when asked for owners, then turn the bot on again. Test with another account if you have one; only yours should get a reply. If a command asks for approval, reply /sim or /nao within 120 seconds; after that, the request expires and the command won’t run.
03 · Optional sequence
Copy the commands and run them in the terminal from the specified folder.
Automated tests use a fake Telegram server: owner filtering, message format, and approval with /sim. INEMA has not tested the bot live.
04 · Check who can send messages
Optional. It depends on your bot and account; INEMA has not tested this integration live.
Complete the setup
8
If you use Telegram, get your /id, enter the number in configurar, and turn the bot on again. If you don’t use it, skip this step; it won’t block the rest of the course.
Done when: The bot replies to your ID; another account won’t get a reply, if you can test with one.
Check an approval
5
In your bot’s chat, send “rode: echo teste > nota.txt”. This asks for approval because it writes a file. Reply /nao first; use /sim only if you really want to create the file. Approval expires after 120 seconds without /sim or /nao.
Done when: The audit records the decision, and the command doesn’t run after /nao.
05 · Check your understanding
Choose before opening the explanation. If you get it wrong, use the link to review.
Question 1 of 3
Where should you store the bot token?
Correct
The vault stores the encrypted secret. telegram_donos contains user IDs only.