This is a Discord bot for the Tucsonians Discord server. The bot relies on a PostgreSQL datastore and utilizes Docker containerization to quickly compose the entire application.
This bot relies on Docker to run all necessary components. As such, installing Docker Desktop is a pre-requisite for development and deployment.
- Make Discord bot with all message permissions and message intent.
- Invite the bot to the desired Discord channel with message permissions.
- Make a Google Cloud account, enable Google Calendar API, and create an OAuth 2.0 Client ID for this application. Ensure that the OAuth consent screen includes the non-sensitive
.../auth/calendar.calendarlist.readonly
scope added. - Download the OAuth 2.0 Client ID JSON into a file named
credentials.json
in the root directory of this project. - Create a
.env
file with the following variables defined:- DISCORD_TOKEN - Token for bot created from discord developer portal
- DISCORD_CHANNEL_ID - Channel ID that bot will be posting in
- CALENDAR_ID - ID of the Google Calendar that the bot will be viewing events on
- Switch to the virtual environment with
virtualenv env && source env/bin/activate
- Install the local dependencies into the environment with
pip install -r requirements.txt
- If you do not have
token.json
in your project's root directory, do an initial run of the application and follow the output prompts usingpython main.py
. If you do, skip to step 9. - After following the steps and verifying that
token.json
is now in the directory, pressctrl+c
to exit the application. - Build the Dockerfile and run the Docker composition with
./run-bot.sh
- On the first run, you will get a prompt to sign into your google account. Make sure this account is added to the desired calendar. This step creates
token.json
in your directory.
- Install WSL and clone project into WSL.
- Follow remaining steps from the Unix setup instructions.