This is a simple Telegram bot designed to integrate with the Plazen application. It allows users to retrieve their daily schedule from their Plazen account directly within Telegram by linking their Telegram Chat ID.
- /start: Get a welcome message and your unique Telegram Chat ID to link to your Plazen account.
- /schedule: Fetch and display your task schedule for the current day (UTC), including completion status, time, title, and duration.
- /help: Show a list of available commands.
- Python 3.x (the code uses
asynciofeatures) - A Telegram Bot. You will need the Bot Token.
- A Supabase project. You will need the project URL and the Service Role Key.
Install the required Python packages using the requirements.txt file:
pip install -r requirements.txt
This project uses a .env file to manage secret keys. Create a file named .env in the root directory.
Add the following environment variables to your .env file:
TELEGRAM_TOKEN=your_telegram_bot_token_here
SUPABASE_URL=https://your-project-id.supabase.co
SUPABASE_SERVICE_KEY=your_supabase_service_role_key
This bot expects a specific Supabase database structure to function:
- A table named
UserSettingswith (at least):user_id(e.g., UUID, Text)telegram_id(Text) - This stores the Chat ID from the /start command.
- A table named
taskswith (at least):user_id(links toUserSettings)scheduled_time(TimestampTz)title(Text)is_completed(Boolean)duration_minutes(Number, optional)
Once your .env file is configured and dependencies are installed, run the bot:
python main.py
The bot will start polling for messages.
This project is licensed under the MIT License. Copyright (c) 2025 Plazen