This project runs as a short-lived Python process. A scheduled invocation gathers the GitHub Blog and YouTube digests, posts them through Discord's HTTP API, and exits. It does not require a continuously running bot or Docker.
- Python 3.11 or newer
- A Discord bot with
Send MessagesandEmbed Linkspermissions - A YouTube Data API v3 key
- A host that can run a weekly cron job
- Create a Discord application and bot in the Discord Developer Portal.
- Copy the bot token as
DISCORD_TOKEN. - Enable Developer Mode in Discord and copy the destination channel IDs.
- Set the
discord_channel_idvalues inconfig/config.yaml.
- Enable YouTube Data API v3 in the Google Cloud Console.
- Create an API key as
YOUTUBE_API_KEY. - Restrict the key to YouTube Data API v3 when possible.
git clone https://github.com/campus-experts/DevRel-Discord-Bot.git
cd DevRel-Discord-Bot
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .envSet DISCORD_TOKEN and YOUTUBE_API_KEY in .env, then run:
python main.pyThe job looks back seven days and posts both digests whenever it is invoked. The cron schedule is responsible for running it on Thursday.
Create a weekly cron job that:
- Runs on Thursday.
- Uses the repository root as its working directory.
- Provides
DISCORD_TOKENandYOUTUBE_API_KEY. - Runs
python main.py.
Equivalent command:
cd /path/to/DevRel-Discord-Bot && /path/to/python main.pyIf one source fails, the process reports failure after attempting both.
config/config.yaml controls:
- GitHub YouTube channel and Discord destination
- GitHub Blog feed and Discord destination
- Blog keywords
- Number of entries and candidate search pool
The process expects these environment variables:
DISCORD_TOKEN=your-discord-bot-token
YOUTUBE_API_KEY=your-youtube-api-keyDevRel-Discord-Bot/
├── bot/
│ └── __init__.py
├── config/config.yaml # Non-secret configuration
├── utils/
│ ├── blog_fetcher.py # GitHub Blog RSS fetcher
│ ├── embeds.py # Discord embed builders
│ └── youtube_api.py # YouTube API wrapper
├── main.py # Cron script: fetch, post, exit
├── requirements.txt
└── tests/
No messages are posted
- Confirm the cron job runs on Thursday UTC.
- Confirm both channel IDs are correct.
- Confirm the bot has
Send MessagesandEmbed Linkspermissions. - Check the cron process output for API or Discord errors.
KeyError: 'YOUTUBE_API_KEY'
- Set the variable in Sparked Host's job environment or in a local
.env.
YouTube API 403
- Confirm YouTube Data API v3 is enabled and the key has remaining quota.