A Telegram bot that monitors your Too Good To Go favorites and notifies you when stock changes occur (new bags, sold out, etc.).
- 🔑 Login – Authenticate with your TGTG account via email + PIN
- ℹ️ Info – Show currently available bags from your favorites
- ⚙️ Settings – Choose which notifications you want (new stock, sold out, stock reduced, stock increased)
- 🚀 Smart Polling – The TGTG API is only queried when at least one user has notifications enabled, preventing unnecessary requests and 403 bans
- Clone this repository
- Create a Telegram bot and obtain a token (guide)
- Run the setup script – it will guide you through everything:
python setup.pyManual setup (alternative)
- Copy
config.ini.exampletoconfig.iniand replace<YOUR_TOKEN>with your bot token - Install dependencies and start the bot:
pip install -r requirements.txt
python Telegram.py- Python 3.10+
- A Telegram bot token
The config.ini file supports the following options:
[Telegram]
token = <YOUR_TOKEN>
[TGTG]
; Optional – only needed if your IP is blocked by TGTG
proxy =| Command | Description |
|---|---|
/start / /help |
Show welcome message |
/login email@example.com |
Start login – sends a PIN to your email |
/pin 12345 |
Complete login with the PIN from your email |
/info |
Show currently available favorite bags |
/settings |
Configure notification preferences |
- Send
/login your@email.comto the bot - Check your email for a PIN code from Too Good To Go
- Send
/pin 12345(with your actual PIN) to complete the login - Done! The bot will now monitor your favorites.
The bot runs a background polling loop that checks the TGTG API every 60 seconds. Crucially, it first checks whether any user has at least one notification type enabled. If all users have disabled all notifications, the API is not queried at all — this minimizes the risk of being rate-limited or banned (HTTP 403) by TGTG.
This project includes a bundled version of tgtg-python in the tgtg/ directory with patches for Datadome bypass and PIN-based authentication (PR #378).
- @TGTG
- @ahivert – Python client for the TGTG API
- @jalaliamirreza – Datadome bypass & PIN auth patch
See LICENSE for details.