odrabiamy-telegram is a Telegram bot client for Odrabiamy.pl
PROJECT NOT MAINTAINED AND NOT WORKING (though it could be modified to be, I no longer have interest in continuing)
- Clone this repository (
git clone https://github.com/NetMan134/odrabiamy-telegram). - Make sure you have docker and docker compose plugin installed on your system.
- Modify variables.env to your values:
ODRABIAMY_LOGINOdrabiamy.pl email address,ODRABIAMY_PASSOdrabiamy.pl password,TG_TOKENTelegram bot token,- better leave PostgreSQL values as default unless you know what you're doing.
- Run
docker compose up -din that directory.
- Stop the instance by running
docker compose down. - Run
git pullto acquire new commits. - Run
docker compose up -d --build.
If the containers behave weirdly, try rebuilding them.
To do that, run: docker compose down and docker compose up -d --build.
- Make sure you have Python 3 installed on your system (for best compatibility, use 3.11.1).
- Set up a PostgreSQL server with a database and ability to read/write, etc. (you can create a docker container with a postgres image), and run a sql instruction from
table.sqlfile. - Modify
./run.shto your values:ODRABIAMY_LOGINOdrabiamy.pl email address,ODRABIAMY_PASSOdrabiamy.pl password,TG_TOKENTelegram bot token,DB_ADDRESSPostgreSQL address,POSTGRES_USERPostgreSQL user,POSTGRES_PASSWORDPostgreSQL password,POSTGRES_DBPostgreSQL database name,DB_TABLEPostgreSQL table name (by default intable.sqlit's specified as "baza"),DB_PORTPostgreSQL port.
- Run:
python3 -m venv odrabiamy-venvsource odrabiamy-venv/bin/activatepip install -r requirements.txtpip install "python-telegram-bot[job-queue]"playwright install-deps(only if using a debian-based distro with apt)playwright install firefoxchmod a+x run.sh
- To start the bot, cd into the bot directory and run
docker compose up -din that directory. - To stop the bot, cd into the bot directory and run
docker compose downin that directory.
- To start the bot, cd into the bot directory and run
./run.shin that directory. - To stop the bot, just press Ctrl-C until you're back at your shell prompt.
If you try to interact with the bot, it will reply with a message about contacting the administrator. also providing user's ID. the user has to give you this ID to get access to your instance of this bot - then insert it into whitelist.txt file located in the repository's folder - you can do that on the fly (you don't have to restart the bot every time you add a new user to the whitelist)
Lines with # at the start qualify as comments, IDs should be put in their own line without any unwanted characters besides numbers of course (duh), spaces etc...
# A comment for example:
# ID below belongs to XYZ
1234567890
# John Smith
9876543215
# Elon Musk
6565656566
# Jeff Bezos
4323424324
# Bill Gates
9090678467
Because Odrabiamy.pl is a polish service, this bot replies in Polish.
People have 2 options (technically 4) to interact with the bot:
- /start - bot will ask for a link, and will show a button list of: exercises from the chosen page, and beside them 2 options: "split" and "all"; when the exercise number is chosen, bot will send only the specified exercise; when "split" will be chosen, bot will seperate all exercises for every individual image; when "all" will be chosen, bot will send all exercises from this page in one image.
/startf - basically the same as /start but forces the bot to download solutions directly from odrabiamy, rather than from a local database cache (you can use this for example if the image contents are corrupted). - /get - the get syntax is: /get
<URL to odrabiamy>, and: if the link redirects to the whole page, bot will send the whole page; if the link redirects to a specific exercise, bot will send a specific exercise.
/getf - basically the same as /start but forces the bot to download solutions directly from odrabiamy, rather than from a local database cache (you can use this for example if the image contents are corrupted).
Odrabiamy.pl has a limit for browsing solutions to exercises, it's 60 exercises a day, and it resets at 12:00 AM every day.
Script after downloading about ~45 pages may crash, and on Odrabiamy.pl webpage, a warning message shown below will be visible.

If you want to continue with acquiring data via this bot, click "Got it" and continue.
- use postgresql
- full dockerization
- provide a user-friendly first-time run shell script (for bare-metal users)
- code clean-up
- more secure way of storing secrets
Using odrabiamy.pl API with external programs, scripts is allowed only with administration consent. User takes all the responsibility for their actions when using this program.
This project is licensed under GNU General Public License Version 3. See LICENSE for more information.