A chat relay is small: a script tag that draws a bubble, a server that stores each message and a Telegram bot that forwards it and maps your reply back to the right visitor. An agent builds that in one sitting on SQLite and grammY, and Intergram shows the pattern is old and works. What you skip is the polish around it: the Mini App inbox, visitor context, reminders and one inbox across sites. The one hard requirement is a server the open internet can reach, because the widget has to talk to something.
Before you buildEloqra's free plan already covers one site with the full chat experience. Paying only starts with a second site, so a replacement saves $4.99 a month per extra site and costs you a server.
Build me a self-hosted chat bubble that forwards visitor messages to my Telegram, to replace Eloqra. Requirements: - Node.js 22 + TypeScript: a Fastify server with @fastify/websocket and grammY. `npm start` serves http://localhost:4900 with /widget.js, /ws and /admin. - Widget: one vanilla-JS file under 8 KB, added with `<script src="https://HOST/widget.js" data-site="SITE_ID" async></script>`. A floating bubble opens a panel; a random visitor id in localStorage reopens the same conversation on return; the socket reconnects with backoff. - Storage: better-sqlite3 in ./data/chat.db: sites (id, name, allowed origins), visitors, conversations (open or resolved) and messages. Save every message before forwarding it. - Telegram: BOT_TOKEN and OWNER_CHAT_ID in .env, long polling so no webhook certificate is needed. A new conversation arrives as one message with the site, page URL, browser and device (parsed from the User-Agent); later messages are prefixed with the visitor's name. - Replying: use Telegram's Reply on a forwarded message and the answer appears in that visitor's panel at once. `/resolve` as a reply closes the conversation; the visitor's next message opens a new one. A message that is not a reply gets a one-line hint back. - Safety: accept sockets only from a site's allowed origins, rate-limit 20 messages a minute per visitor, cap messages at 2,000 characters and escape everything rendered in the panel. - Admin: /admin behind ADMIN_PASSWORD (signed cookie) to create sites, copy the snippet and read transcripts. - Single owner. No accounts, no telemetry, local-first: the only outbound calls go to Telegram. - Out of scope: email fallback, file uploads, typing indicators, several operators, translations. - README: the BotFather steps, exposing the server through a Cloudflare Tunnel or a small VPS with Caddy, and a warning that the bubble only works while the server is reachable.
Opens your agent with the prompt filled in, you press enter. Or copy it and paste it into an empty folder.
The first prompt builds the core. Run these one at a time in the same folder to grow it into your own Eloqra.
Add unanswered-chat reminders to the chat relay in this folder. Requirements: - If a visitor message gets no reply within REMINDER_MINUTES (default 10, set in .env), send one reminder to Telegram quoting the first 80 characters; a reply or `/resolve` cancels it. - Respect online hours from OPEN_FROM, OPEN_TO and TIMEZONE in .env. Outside them, show the visitor "We're offline, leave your email" and save the email with the conversation. - Persist pending reminders in SQLite so a restart does not lose them. - Update the README.
Switch the chat relay in this folder to a Telegram forum group. Requirements: - Add TELEGRAM_GROUP_ID to .env for a supergroup with Topics turned on; create one topic per conversation, named after the visitor and the site. - Anything typed in a topic goes to that visitor; closing the topic marks the conversation resolved, and a new visitor message reopens a fresh topic. - Keep the private-chat mode working when TELEGRAM_GROUP_ID is empty. - Update the README with the steps to make the bot an admin with the Manage Topics right.
Add an optional pre-chat form to the chat relay in this folder. Requirements: - Per site, a switch for asking name and email before the first message, each with a required flag. - Validate the email, add a hidden honeypot field and reject submissions that fill it. - Store the answers on the visitor, show them in the first Telegram message and in /admin. - Skip the form for returning visitors who already answered. - Update the README.
Most don't: the first project is free, so only a second or third site costs $4.99 a month. The reason to pay is that it runs without a server of your own, with no tunnel, bot process or database to look after.
Estimate · A free tunnel to a machine that stays on costs nothing; a small VPS is the steadier choice at around $5. Telegram's bot API is free. The build is token usage on your agent plan.
| Plan | Monthly | Annual, per month | What you get |
|---|---|---|---|
| Free | $0 | $0 | 1 project, chat widget on every page, messages forwarded to Telegram, operator Mini App, visitor context (page, device, country), optional pre-chat form, widget in 10 languages. |
| Pro | $4.99 | $4.17 | One extra project slot per purchase (1 to 20 at a time); each project has its own widget, settings and Telegram link. No per-seat or per-message charge. |
Free covers one project forever: the chat widget on every page, Telegram forwarding, the operator Mini App and a pre-chat form.
Yes. An AI coding agent such as Claude Code, Codex or Cursor can build a usable personal version in one session with the prompt on this page, running on your own machine.
About $4.99 a month on the Pro (per extra project) plan, $59.88 a year (checked 2026-10-19).
The operator Mini App with an inbox, resolve and reopen, so you can answer from one screen inside Telegram; Visitor context cards with page, device and country on every conversation; Unanswered-chat reminders, online hours and a settings page for the widget's look and wording; One combined inbox across several sites; Someone else keeping the endpoint up: if your server is down, the bubble goes silent. If any of those matter to you, keep paying.
Yes: Chatwoot (open source), Chaskiq (open source), Tiledesk (open source).