This Telegram bot integrates with Google Calendar to help users manage their events and set reminders. It allows users to check their upcoming events and set custom reminders through a simple chat interface.
- View the next upcoming event from your Google Calendar
- Set custom reminders for events
- Receive notifications before events based on your preferences
/startor/hello: Greet the bot and start the interaction/help: Display help information and available commands/set_reminder <minutes>: Set a reminder for a specified number of minutes before events/upnext: Show your next upcoming event
- Clone this repository
- Install the required dependencies:
pip install python-dotenv python-telegram-bot google-auth-oauthlib google-auth-httplib2 google-api-python-client
- Set up a Telegram bot and obtain the bot token from BotFather
- Create a Google Cloud project and enable the Google Calendar API
- Download the
credentials.jsonfile for your Google Cloud project - Create a
.envfile in the project root and add your Telegram bot token:
BOT_TOKEN=your_telegram_bot_token_here
- Run the script:
python bot.py
On first run, you'll need to authenticate with your Google account. The script will open a browser window for you to complete the OAuth2 flow. After successful authentication, a token.json file will be created to store your credentials.
This bot uses the google-auth-oauthlib library, which requires a local server for the OAuth2 flow. The server runs on port 8080 by default.
Feel free to fork this repository and submit pull requests with any improvements or bug fixes.