This project automates the process of securing a doctor's appointment at Medicover. It is inspired by:
- medihunter: https://github.com/medihunter/medihunter
- luxmed-bot: https://github.com/dyrkin/luxmed-bot
This project has been a standalone fork from the medihunter repo.
The project provides:
- CLI Tool: For setting up and managing appointment monitoring.
- Telegram Bot: A user-friendly interface to interact with the appointment management system.
- Python: Version 3.12 or newer.
poetry
- Clone the repository:
git clone git@github.com:thisi5patrick/medibot.git
cd medibotInstall the dependencies with poetry
poetry installThe CLI lets users create appointment monitoring sessions and view future appointments through their Medicover account.
-
new_monitoring: Create a new monitoring session to look for available appointments.- Usage:
python src/app.py new-monitoring [options] - Options:
--username: Your Medicover username. (required)--password: Your Medicover password. (required)--location_id: The ID of the location. (required)--specialization_id: The ID of the specialization. (required)--clinic_id: The ID of the clinic. (required)--doctor_id: The ID of the doctor. (required)--date_start: The start date of the monitoring session. (optional, default:current date)--time_start: The start time of the monitoring session. (optional, default:07:00)--date_end: The end date of the monitoring session. (optional, default:current date + 30 days)--time_end: The end time of the monitoring session. (optional, default:23:00)
- Usage:
-
future_appointments: View your future appointments.- Usage:
python src/app.py future-appointments [options] - Options:
--username: Your Medicover username. (required)--password: Your Medicover password. (required)
- Usage:
Note: If required options are not provided, the script will ask for it in an interactive mode.
Note 2: You can install the package with pip install -e . which will let you to interact with the CLI via medibot <command> instead of python src/app.py
The CLI provides a way to send notifications to telegram when the monitoring has found an available appointment date.
In order for this to work, you must set up a Bot in telegram by your own.
More info can be found in the documentation.
After setting up, you must gather these variables.
NOTIFIERS_TELEGRAM_CHAT_ID=<your chat id>
NOTIFIERS_TELEGRAM_BOT_TOKEN=<your bot token>You can find these data by following this guide.
Place these variables into .env file or by exporting them like
export NOTIFIERS_TELEGRAM_CHAT_ID=<your chat id>
export NOTIFIERS_TELEGRAM_BOT_TOKEN=<your bot token>The Telegram bot provides an easy-to-use interface to interact with the system. It offers the following commands (once logged in):
/start: Start the bot./login: Authenticate with your Medicover account./new_monitoring: Set up appointment monitoring./active_monitorings: View and manage active appointment monitorings./future_appointments: Display the list of upcoming appointments./settings: Modify bot settings (e.g., language)./help: Access the help page.
In order to set up and run your own telegram bot, you must provide the following env variable:
TELEGRAM_BOT_TOKEN=Place these variables into .env file or by exporting them like
export TELEGRAM_BOT_TOKEN=<your telegram bot token>Now you can run the bot on your machine with:
make run-telegramThe project provides Docker configurations to simplify the process of running both the CLI tool and the Telegram Bot. Below are the steps to build and run the application using Docker.
To simplify building and running the Docker containers a Makefile is provided with
the necessary commands.
In order to build and run the image, use the command:
make docker-telegramThis will build the proper images and automatically start the Telegram bot.
This make command only builds the image:
make build-docker-cliIn order to run the image use:
docker run -it --rm cli-bot <your-options>- Create a New Monitoring Session:
docker run -it --rm cli-bot new-monitoringdocker run -it --rm cli-bot new-monitoring
--username=<your-username>
--password=<your-password>
etc.- View Future Appointments:
docker run -it --rm cli-bot future-appointments