Discord bot
Music
Play from YouTube, SoundCloud, Spotify links and radio in voice. The bot watches its music servers and moves the music when one lags, drops songs or gets blocked by YouTube.
Playing music#
/music play(,p) a name or link ·playnext·playskip·skip·pause/resume·stop·queue·nowplayingvolume·loop(track / queue) ·shuffle·seek·move·remove·clear·filter(bass boost, nightcore, 8D…) ·lyrics·autoplay·247radiostations, aquiz(guess the song), savedplaylists,historyandgrab(DM yourself the song).- A song request channel (Panel → Music): everything typed there is queued and the player message stays on top.
- DJ role, a music-only channel, max song length, leave-when-idle and 24/7 are in Panel → Music.
Music servers and failover#
Music runs on Lavalink servers. The bot rates each one all the time and plays on the healthiest:
What it watches
| Answer time | ms | How fast the server answers (checked every 2 minutes). |
| Audio dropped | % | Lavalink's own count of lost audio frames. Over 12% for two minutes in a row moves the music to a healthier server. |
| Failed songs | 30 min | Each failure counts against the server. |
| YouTube block | 20 min | "Sign in to confirm you're not a bot": that server isn't used for YouTube for 20 minutes. |
| Voice connection | If Lavalink loses the voice connection while a song plays, the bot reconnects it, then moves servers if it keeps dropping. | |
| Version | 4.2+ | Discord's voice encryption (DAVE) needs Lavalink 4.2.0 or newer; older ones are only a last resort. |
When a song fails, the bot tries, in order: the same song on another healthy server, then the same song from SoundCloud (close to the same length), and only then skips it. While YouTube blocks a server, new searches go to SoundCloud straight away.
Bot settings (workers/.env)
| LAVALINK_URL / LAVALINK_PASSWORD | Your own server. | |
| LAVALINK_NODES | url|password;… | Backups of your own. |
| MUSIC_PUBLIC_NODES | backup · on · off | Free public servers from community lists. backup (default): only while yours don't work; on: always in the mix. |
| MUSIC_PUBLIC_MAX | 0–6 | How many public servers stay connected on standby (3). |
| MUSIC_PUBLIC_LIST | https URL · off | A JSON list of public servers to add to the built-in one. |
| MUSIC_SEARCH | ytsearch… | Where names are searched. |
| MUSIC_FALLBACK_SEARCH | scsearch | Where a song YouTube won't play is looked up instead. |
Public servers
Free public servers are run by other people. They see what's played and the bot's ID, and they can disappear any time; the bot checks them every 15 minutes and swaps out bad ones. For a big server, run your own Lavalink and keep the public ones as backup.Fixing "Sign in to confirm you're not a bot"#
- Update the youtube-source plugin to the newest version.
- Give it OAuth with a spare Google account, or a poToken, or a remote cipher server (see
workers/lavalink/application.yml.example). - Meanwhile music keeps playing from other servers or SoundCloud.
Checking it#
,music status in Discord and Panel → Music show every server with its health (answer time, audio dropped, failed songs, YouTube block), the voice connection and what the bot did about recent problems. See also Web panel.