Discord Bot with Google Sheets Integration
This Discord bot allows users to set reminders, add events, manage work pauses, and update Google Sheets with job application information. The bot leverages gspread
and oauth2client
for Google Sheets integration and uses discord.py
for interacting with Discord.
Features
/remind: Set a reminder at a specified time with a custom message.
/add_event: Schedule an event at a specified date and time.
/wp: Start and stop work-pause reminders.
/update: Immediately append job application information to a Google Sheet.
Requirements
Python 3.6+
A Discord bot token
Google Sheets API credentials
Required Python packages (listed in
requirements.txt
)
Setup
Clone the repository:
git clone https://github.com/your-username/your-repo-name.git cd your-repo-name
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
Install the required packages:
pip install -r requirements.txt
Set up Google Sheets API credentials:
Follow the instructions to create a Google Cloud project and enable the Google Sheets API.
Create credentials for a service account and download the JSON key file.
Place the JSON key file in the
src/constants
directory and name ittoken.json
.
Create a
.env
file in the root directory of the project and add your credentials:BOT_TOKEN=your-discord-bot-token GOOGLE_SHEETS_CREDENTIALS_PATH=src/constants/token.json SHEET_NAME=Your Google Sheet Name WORKSHEET_NAME=Sheet1
Run the bot:
python app.py
Usage
/remind HH:MM Message: Set a reminder for a specified time with a custom message.
/add_event YYYY-MM-DD HH:MM Event: Schedule an event at a specified date and time.
/wp start {time in minutes}: Start work-pause reminders.
/wp end: End work-pause reminders.
/update JSON: Append job application information to a Google Sheet. Use backticks (`) around the JSON data to avoid issues with Discord command parsing.
Example:
/update `{"Name of Company": "Discord", "Job Title": "Engineer", "Job ID": "12345", "Link": "https://discord.com/careers", "Status": "Applied", "Location": "NY"}`