This bot integrates with Google Calendar API to fetch upcoming events and post them in a specified Discord channel.
- Fetches events from Google Calendar.
- Posts events to a specified Discord channel.
- Automatically updates and posts new evetns every 10 minutes.
- Python 3.7 or higher
- Discord bot token
- Google Calendar API credentials
-
Clone the repository:
git clone https://github.com/codeiaks/discord-calendar-bot.git cd discord-calendar-bot
-
Install dependencies:
Create and activate a virutal environment (optional):
python -m venv venv source venv/bin/activate # On Windows, use 'venv\Scripts\activate'
Install the required Python packages:
pip install -r requirements.txt
-
Obtain Google Calendar API credentials:
- Follow Google's instructions to set up API access and download
credentials.json
. - Place the
credentials.json
file in the root directory of the project.
- Follow Google's instructions to set up API access and download
-
Obtain Discord bot token:
- Create a new Discord bot and obtain the token. Follow the instructions on the Discord Developer Portal.
-
Configure the bot:
- Replace placeholders in
discord_calendar_bot.py
with your actual Discord bot token (TOKEN
) and channel ID (CHANNEL_ID
).
- Replace placeholders in
-
In the
discord_calendar_bot.py
file, replace the following placeholders with your actual values:# Replace with bot token TOKEN = 'YOUR_DISCORD_BOT_TOKEN' # Replace with channel ID CHANNEL_ID = YOUR_CHANNEL_ID
-
Run the bot:
python discord_calendar_bot.py
The bot will fetch Google Calendar events every 10 minutes and post them in the specified Discord channel.
Feel free to contribute to this project! Fork the repository and submit a pull request with your changes.