A Telegram bot for monitoring Monzo bank balances and ensuring timely direct debit payments.
I have a friend living in the UK who uses Monzo as his primary bank account. He often forgets to top up his balance account and misses direct debit payments. This bot was created to help him keep track of his balance and avoid late payment fees and bad credit score. It's also a great opportunity to learn about the Monzo API and Telegram bot development.
Balance Checker is a simple yet powerful tool designed to help you keep track of your Monzo bank account balance. It uses a Telegram bot to provide real-time balance updates and reminds you of upcoming direct debits. This ensures you never miss a payment due to an insufficient balance. The project is open-source and contributions are warmly welcomed.
Contributor: AnsonDev42
Reviewer and Prospective Contributor: hanwe98
For the bot to function properly, you need to set several environment variables. Rename .env.example
to .env
and fill in the bold fields. You'll need:
- OAuth Client_ID and Client_SECRET from Monzo Bank.
- Your domain name (BASE_URL and REDIRECT_URI), and set up REDIRECT_URI on the Monzo developer portal for redirection.
- SSL certificate and key (stored in
balance_checker/ssl
). - A reverse proxy server (like nginx or Cloudflare Tunnel) to redirect traffic from your local FastAPI server to your domain.
- A Redis database (REDIS_HOST and REDIS_PASSWORD) — skip if using docker-compose.
- TELEGRAM_BOT_API_TOKEN from Telegram.
- A URL-friendly SECRET_DEV token for secure server-bot communication.
- Install Docker and Docker Compose.
- Edit
docker/.env-docker
with your API keys. - Execute
docker compose up -d
in the project's root directory.
- Install Python 3.12, pipx, and dependencies.
- Access
YOUR_DOMAIN_NAME/ping
to verify server functionality.
below steps refer to the numbers in demo image above
/start
to initiate the bot and designate yourself as the admin./connect_to_monzo
to link your Monzo account.- click the link to authorize the bot to access your Monzo account (you'll need to log in to Monzo via Email). After authorization by email, you'll be redirected to the callback URL and you can safely close the page.
- authorize the bot in Monzo app
/get_balance
to receive your current balance./set DDHHMM
to receive a notification every month at day (DD), hour:minite (HHMM) before your direct debit payment is due. For example,/set 151000
will send you a notification at 3pm on the 15th of every month.
- Install Poetry:
pipx install poetry
. - Install dependencies:
poetry install
. - Activate the virtual environment:
poetry shell
.
We utilize pre-commit for code quality checks.
- Install pre-commit:
pipx install pre-commit
. - Install hooks:
pre-commit install
. - Optionally, run
pre-commit run --all-files
.
This project is not affiliated with Monzo Bank or Telegram. It's an independent tool designed for convenience. Users are responsible for secure handling of their data and the consequences of using this bot. The developer assumes no liability for any financial losses or breaches of privacy arising from the use of Balance Checker.