Telegram Bot ยท Python ยท No app to install

No sign-up sheets.
Just message the bot.

LaundryBot turns a dorm's washers and dryers into a guided Telegram conversation โ€” pick a machine, set a timer, and it frees itself automatically when time's up.

5 washers ยท 4 dryers Long polling โ€” no server JSON, not a database Survives restarts
Live in Telegram

The interface is the conversation.

๐Ÿงบ LaundryBot
bot
/start
Washer or dryer? ๐Ÿงบ
Washer
Which machine's free? A ยท B ยท D ยท E
A
How many minutes?
40
โœ… Machine A booked for 40 minutes.
/view
Machine A โ€” 32 min remaining
/free
Machine A released. Thanks! ๐Ÿ‘‹

The real bot replies in Italian for its dorm โ€” this is the English gist.

How it works

It only offers what's free.

Machines only show up as options if nothing's using them. A background task tracks every booking's timer and releases the machine automatically โ€” or you can free it early. Everything's written to a local JSON file, so a restart doesn't lose a single booking; anything already expired is just quietly dropped on load.

/startBegin a new booking โ€” a guided conversation
/viewShow active bookings with remaining time
/freeRelease a machine before the timer expires
/cancelAbort the current operation mid-conversation
/helpList available commands
Under the hood

Built for one dorm, on purpose.

Python 3.10+python-telegram-bot โ‰ฅ22.0Local JSON storage
โ€”

Long polling over webhooks, deliberately. This runs on a student laptop, not a server with a public IP or SSL certificate โ€” long polling needs no infrastructure at all. Moving to webhooks later is a one-line change.

โ€”

JSON over SQLite, for the same reason. At most 9 machines are ever booked at once โ€” a database would add a dependency with no real benefit at this scale.

โ€”

requirements.txt still lists Flask, held in reserve for a future webhook or dashboard that doesn't exist yet โ€” and data/users.json sits in the repo without a single line of app.py reading it.

Security notes

What's protected, what isn't.

โœ“

Token stays local. config.py is gitignored and never committed.

โœ“

No data leaves the host. Bookings live in a local JSON file โ€” no external database.

โœ“

No open ports. Long polling only calls out to Telegram; nothing listens for inbound connections.

!

No authentication yet. Anyone who finds the bot on Telegram can use it โ€” a chat_id whitelist is the recommended fix before a wider rollout.

Get started

Set it up for your own dorm.

01

Clone the repository

git clone https://github.com/mirconegri/LaundryBot.git
02

Set up the environment

python -m venv venv then pip install -r requirements.txt

03

Add your bot token

cp config.example.py config.py, then set BOT_TOKEN โ€” get one from @BotFather on Telegram.

04

Run it

python app.py โ€” then message your bot /start.

Built in the open, one load at a time.

Look at the code, open an issue, or adapt it for your own dorm.