E3 · Install inemaccbot
1 hFollow the steps until the bot replies on Telegram. Pair it with ALLOWED_CHAT_IDS=0 and check that .env has chmod 600. Then test /ajuda and /fila.
Done when: /ping replies in your Telegram, and /fila shows empty queues.
Lesson 4 · 20 min
inemaccbot is a Telegram gateway with a durable queue: you send a request from your phone, and your computer (or a VPS) runs it as an agent. In this lesson, you install the bot, pair it with your chat, and set it up to run as a service.
Start lesson
Goal: install inemaccbot, pair it with your chat, and see /ping get a response in Telegram.
From your phone to the result.
Click each block. You don’t need to change any code to install and use it: just the .env and Telegram.
Tested on Ubuntu with Node 24. The shortcut ./scripts/instalar.sh handles the mechanical steps and stops where you need to take over.
Node 22 or newer (node -v; Ubuntu 24.04 comes with 18). claude installed and logged in: check with claude auth status; installed doesn’t mean authenticated. ffmpeg and python3 for audio and video tasks.
Without claude logged in, the bot starts and accepts commands, but every agent task fails. This is the most confusing failure because everything looks right.
Clone the repository and run npm ci (not npm install: ci follows the lockfile, so the installation is the same on every machine).
Also clone the promoavatar and promoavatar3 domain repos as sibling folders. Without them, the bot starts, but flows break in the first phase and dozens of tests fail.
Talk to @BotFather, send /newbot, and save the token it returns. That value is BOT_TOKEN.
The token is a secret: never put it in Git, a screenshot, or a message.
Copy .env.example, protect it with chmod 600, and fill in BOT_TOKEN, QUEUE_DB, STATE_DIR, and LOG_FILE.
Set ALLOWED_CHAT_IDS to 0. This is pairing mode: the first /ping registers your chat as the owner and closes the gate. Leaving it empty is not pairing: it is an intentional error, and the bot will not start.
While the allowlist is 0, whoever sends /ping first gets the bot. Pair it before leaving it running.
Run npm test and npm run build, then start it manually with ./start.sh to see any errors on screen.
Send /ping to your bot. It replies with the chat ID and saves it in .env. From then on, only you can use it.
To keep the bot running after you log out and start it automatically at boot, install the user service and enable linger. On a VPS, use the system service (deploy/inemaccbot-sistema.service).
Never run ./start.sh and the service at the same time with the same token: they compete for messages, and each one misses half. start.sh already refuses to start when the service is active.
In order. Change only what is indicated.
cd ~/projetos git clone https://github.com/inematds/inemaccbot.git git clone https://github.com/inematds/promoavatar.git git clone https://github.com/inematds/promoavatar3.git cd inemaccbot ./scripts/instalar.sh --checar # only reports what's missing; changes nothing npm ci npm test npm run build
cp .env.example .env chmod 600 .env # edit .env: BOT_TOKEN=<from BotFather> ALLOWED_CHAT_IDS=0 ./start.sh # log on screen; Ctrl+C stops after draining anything that's running # in Telegram: /ping → the bot replies and saves your chat id
mkdir -p ~/.config/systemd/user cp deploy/inemaccbot.service ~/.config/systemd/user/ systemctl --user daemon-reload systemctl --user enable --now inemaccbot loginctl enable-linger "$USER" systemctl --user status inemaccbot # wait for: active (running)
The recovery line appears in the log, even when the queue is empty:
boot: lease recovery — requeued=0 failed=0
A configuration error stops the process here on purpose. Read the message before changing anything else.
config: falta BOT_TOKEN: the .env file does not have the token./ping does not reply: the allowlist has the wrong ID (the log shows rejeitada — fora da allowlist).claude is not logged in.tsc: not found during the build: reinstall with NODE_ENV=development npm ci --include=dev.The bot's .env stores configuration: token, allowlist, paths. Keys for other services live in a separate vault, one file per machine with chmod 600, never under version control. Project rule: .env stores the path and ID; a third-party secret lives in its owner's file.
Set aside one uninterrupted hour.
Follow the steps until the bot replies on Telegram. Pair it with ALLOWED_CHAT_IDS=0 and check that .env has chmod 600. Then test /ajuda and /fila.
Done when: /ping replies in your Telegram, and /fila shows empty queues.
Complete step-by-step guide, including VPS and dedicated user: inemaccbot README.
The explanation appears after your answer.
Question 1 of 3
The service is active (running), but the bot does not reply to your /ping. What is the most likely cause?
Question 2 of 3
Why set ALLOWED_CHAT_IDS=0 on the first start?skill
Question 3 of 3
Where should you keep the key for a third-party service used by a task?
Choose an option. The explanation appears after you try.