Queues: ten tasks and go to sleep|INEMA.CLUB-PRO

Lesson 4 · 20 min

Install inemaccbot until /ping responds

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
A small computer with subtle LEDs and a phone showing a conversation.

In this lesson, you’ll

  1. 1The pieces: Telegram, queue, worker, agent
  2. 2Prerequisites and what breaks without each one
  3. 3Token, allowlist, and pairing mode
  4. 4Start it manually, then run it as a service

Goal: install inemaccbot, pair it with your chat, and see /ping get a response in Telegram.

01The pieces of inemaccbot

From your phone to the result.

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

Click each block. You don’t need to change any code to install and use it: just the .env and Telegram.

02Installation in six steps

Tested on Ubuntu with Node 24. The shortcut ./scripts/instalar.sh handles the mechanical steps and stops where you need to take over.

1. Prerequisites

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.

03Installation commands

In order. Change only what is indicated.

Terminal · clone, install, test
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
Terminal · .env and first start
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
Terminal · run as a user service
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)
Repository example

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.

04Practice

Set aside one uninterrupted hour.

E3 · Install inemaccbot

1 h

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.

05Test what you learned

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?

To learn more

Previous lessonNext lesson