This project is a Discord bot designed to monitor a GitHub repository for new internship postings and send formatted messages to a specified Discord channel. The bot performs the following tasks:
- Clones or updates the specified GitHub repository.
- Reads a JSON file containing internship listings.
- Compares the new listings with previously stored data.
- Sends formatted messages to a Discord channel for any new visible and active roles.
- Python 3.6 or higher
- Git
- Discord bot token
- Discord channel ID
-
Clone the repository:
git clone https://github.com/Ouckah/Summer2025-Internships.git cd Summer2025-Internships
-
Install the required Python packages:
pip install -r requirements.txt
-
Set up your Discord bot:
- Create a new bot on the Discord Developer Portal.
- Copy the bot token and paste it into the
DISCORD_TOKEN
variable inmainbot.py
. - Get the channel ID where you want the bot to send messages and paste it into the
CHANNEL_ID
variable inmainbot.py
.
-
Run the bot:
python mainbot.py
-
The bot will start and perform the following actions:
- Clone or update the GitHub repository.
- Read the JSON file containing internship listings.
- Compare the new listings with previously stored data.
- Send formatted messages to the specified Discord channel for any new visible and active roles.
Clones the repository if it doesn't exist locally or updates it if it already exists.
Reads a JSON file and returns the loaded data.
Generates a formatted message for a new internship posting, including details such as company name, role title, location, season, sponsorship, and posting date.
Checks for new roles, compares them with previous data, and sends messages for new visible and active roles.
Sends a message to a Discord channel identified by the provided channel ID, handling various exceptions that may occur during the process.
Prints a message when the bot is logged in and then continuously runs a schedule while sleeping for 1 second in between.
The bot uses the schedule
library to check for new roles every minute. This can be adjusted by modifying the scheduling interval in the mainbot.py
file.