Skip to content

Telegram bot that checks if a website is reachable from your Raspberry Pi (thus, from Hungary if your Pi is on a Hungarian ISP). Designed to run in Portainer via Docker.

Notifications You must be signed in to change notification settings

pixelzsoldos/hunreachbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HUReachBot

Telegram bot that checks if a website is reachable from your Raspberry Pi (thus, from Hungary if your Pi is on a Hungarian ISP). Designed to run in Portainer via Docker.

Default language: Hungarian. Users can switch per chat to English.

Features

  • Commands in private or group chats
    • Group chats: the bot replies directly in the chat by mentioning the requesting user and replying to their message.
    • /check <domain|url> — checks reachability from the Pi (DNS + HTTP(S)). If missing/invalid argument, it returns usage.
    • /lang <hu|en> — sets the chat language (default: hu)
    • /help — lists all commands
  • Uses long polling; no inbound ports required
  • Config via environment variables in a .env file

Requirements

  • Raspberry Pi with Docker and Portainer (ARM compatible)
  • Telegram bot token (from @BotFather)

Setup

  1. Clone this repository and enter the directory.

  2. Create your .env from the example and fill in your bot token:

cp .env.example .env
# edit .env and set TELEGRAM_BOT_TOKEN
  1. Build and run via Docker Compose (Portainer is also supported):
docker compose up -d --build
# nézd a logokat
docker compose logs -f hucheckbot
# ha kell bőbeszédű log
export DEBUG=1 && docker compose up -d --build

Portainer: Add Stack, illeszd be a docker-compose.yml tartalmat, add meg az .env-et. A részletes logoláshoz állíts be egy környezeti változót: DEBUG=1.

File structure

  • src/ — TypeScript/Node.js bot (frontend friendly)
    • src/locales/hu.ts, src/locales/en.ts — nyelvi fájlok
  • docker-compose.yml — convenient stack definition
  • .env.example — template for env vars

Environment variables

  • TELEGRAM_BOT_TOKEN — required
  • DEFAULT_LANG — optional, hu or en (default: hu)

Notes

  • Language preference is stored in memory per chat. If you want persistence across restarts, mount a small volume and implement simple JSON/SQLite storage. The current implementation keeps it simple.
  • The bot verifies reachability using DNS resolution and HTTP(S) HEAD/GET from the Pi, which reflects your local ISP routing in Hungary.

Usage examples

  • In a group chat, just type /check google.hu. The bot will reply to your message and mention you.
  • /check google.hu
  • /check https://google.hu
  • If you omit the target: /check → the bot returns usage instructions.
  • /lang en
  • /lang hu

License

MIT

About

Telegram bot that checks if a website is reachable from your Raspberry Pi (thus, from Hungary if your Pi is on a Hungarian ISP). Designed to run in Portainer via Docker.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published