A Discord bot for playing SoundCloud songs in voice channels. Unlike other SC bots, MootBot supports newer SoundCloud tracks that use HLS streaming instead of direct MP3 URLs.
SoundCloud recently changed how uploaded tracks are stored — newer tracks no longer expose MP3 URLs in metadata and are streamed exclusively via HLS. MootBot handles this by:
- Dynamically extracting a SoundCloud client ID from their JS bundles
- Resolving track URLs via the SoundCloud API
- Fetching HLS playlists (M3U8) and downloading audio segments with retry logic
- Streaming segments through ffmpeg to transcode fMP4/AAC to Opus in real-time for Discord voice
Playback starts almost immediately — no need to buffer the entire track first.
| Command | Description |
|---|---|
/play <url> |
Play a SoundCloud track in your voice channel |
/skip |
Skip the current track |
/pause |
Pause playback |
/resume |
Resume playback |
/stop |
Stop playback, clear queue, leave channel |
/queue |
Show the current queue |
/np |
Show the currently playing track |
- Node.js 18+
- A Discord bot application with the bot scope and these permissions:
- Connect
- Speak
- Use Slash Commands
git clone https://github.com/jmeltz/mootbot.git
cd mootbot
npm installcp .env.example .envEdit .env:
DISCORD_TOKEN=your-bot-token
DISCORD_CLIENT_ID=your-bot-client-id
GUILD_ID=your-dev-server-id # optional, for faster command registration during dev
npm startReplace YOUR_CLIENT_ID with your bot's client ID:
https://discord.com/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=3145728&scope=bot%20applications.commands
Any VPS or always-on machine works. The bot needs a persistent connection so serverless platforms won't work. Use systemd or screen/tmux to keep it running:
# systemd
sudo systemctl enable --now mootbot
# or screen
screen -S mootbot
npm start
# Ctrl+A, D to detachffmpeg is bundled via ffmpeg-static, so no system install is needed.