YouTube Discord Bot
Discord Bot that automatically tracks YouTube channels for new videos and live streams and pushes notifications to designated channels.

Project Overview
An automated Discord bot built with discord.js v14 (ES Modules) and Node.js that monitors subscribed YouTube channels and pushes new video and live stream notifications to designated Discord channels. Supports scheduled crawling (every hour on the hour and half-hour), manual triggers, upcoming stream alerts with user mentions, and full slash command management. MongoDB records pushed history to prevent duplicate notifications.
Technical Challenges & Solutions
YouTube Crawler Reliability
YouTube's page structure is rendered by JavaScript, making simple HTTP crawling unreliable, while heavy Puppeteer usage is slow and resource-intensive.
Duplicate Push Prevention
The bot must not re-notify users about content already pushed, even after service restarts.
Upcoming Stream Alerts
Users wanted advance notice before a live stream starts, not just a notification when it goes live.
Architecture

Pure ES Module Node.js architecture using discord.js v14 slash commands. A dual-crawler strategy combines node-fetch + Cheerio (primary fast crawl) with Puppeteer (fallback for JS-rendered pages). PM2 manages the process lifecycle and scheduled restarts. MongoDB (Mongoose ODM) stores push history per channel. Docker is available for containerized deployment.
Learnings
This project deepened my understanding of Discord bot development with the modern slash command API (discord.js v14), web scraping strategies for JavaScript-heavy sites, and reliable scheduled task design. Handling deduplication across restarts and building a maintainable command structure were particularly valuable lessons.