Send a notification on Discord when you upload a new YouTube video.
- Clone the project or download it.
- Open a terminal in the project folder.
- Run npm install to install the dependencies.
- Rename the file example.env to .env.
Rename .env-example
to .env
.
Fill in the following details in the .env
file:
WEBHOOK_URL= # Discord webhook URL
AVATAR_URL= # URL du webhook Discord
YOUTUBE_CHANNEL_ID= # YouTube channel ID (find it here: https://www.youtube.com/account_advanced)
MONGODB=mongodb://localhost:27017/discordbot
Make sure you have a MongoDB instance ready (local or remote).
By default, the script connects to:
mongodb://localhost:27017/discordbot
.
If you use a different address, update it in the main script or add it as an environment variable.
-
Run the following command to start the script:
bash node index.js
The script will check for new videos every 5 minutes.
- Keep the script running in the background: If you want the script to run continuously on a server, use pm2:
pm2 start index.js --name "Webhook-Youtube"
You can replace "Webhook-Youtube" with any name you prefer.
Preview
Made with 💖 by TutoRapide