A Discord bot that plays an Azuracast live stream in a voice channel and provides information about currently playing songs.
[!NOTE] If your just looking to add the RBC Radio bot in your server to enjoy some songs from RBC Radio, consider adding the bot here.
[!WARNING]
The minimum required Node.JS version is v22
Install FFmpeg (Required for audio streaming)
Ubuntu/Debian:
sudo apt update
sudo apt install ffmpeg
macOS:
brew install ffmpeg
Windows: Download from https://ffmpeg.org/download.html and add to PATH
npm install
Configure Environment Variables
Create a .env file in the root directory:
# REQUIRED
DISCORD_TOKEN=your_discord_bot_token_here
CLIENT_ID=your_discord_bot_client_id_here
# Spotify Artwork Fetching
SPOTIFY_CLIENT_ID=your_spotify_client_id_here (optional)
SPOTIFY_CLIENT_SECRET=your_spotify_client_secret_here (optional)
# If you want the bot to autorejoin after shutdown
MONGODB_URI=
# If you want to change from the RBC Radio Feed
STREAM_URL=https://your-radio-station.com/stream.mp3
API_URL=https://your-azuracast-instance.com/api/nowplaying/yourstation
REQUESTS_URL=https://your-radio-website.com/requests
USER_AGENT=your-bot-name/1.0 (Icecast client; your-info)
To get these values:
DISCORD_TOKENCLIENT_IDInvite Bot to Server
Replace CLIENT_ID with your bot’s client ID:
https://discord.com/api/oauth2/authorize?client_id=CLIENT_ID&permissions=3148800&scope=bot%20applications.commands
Required permissions:
node bot.js &
Kill the bot
pkill node
Use pm2 to keep online 24/7
npm install -g pm2
pm2 start bot.js --name azuracast-discord-bot
pm2 save
pm2 startup
Admin Only:
/setvc [channel] - Set the voice channel for the radio bot to connect to (Admin only)/leavevc - Disconnect the bot from the current voice channel (Admin only)Public:
/nowplaying - Show the currently playing song with artwork and Spotify link/requests - Get information about making song requests/credits - Show credits and information about this bot/leavevc)/setvc and /leavevc) require Administrator permissionsA Creation of Nate Wombwell