Voice and media
How do music bots work on Discord?
How Discord music bots work: joining voice, streaming audio from sources, managing queues, and why many bots avoid YouTube. Includes common fixes.
A Discord music bot joins a voice channel as a participant, finds audio from a source, and streams it into the channel while you control it with commands or buttons. The bot doesn't play music from your device: it fetches the audio itself, encodes it, and sends it to Discord's voice servers, which deliver it to everyone listening.
How does a music bot play audio?
The basic flow has five steps:
- You ask for a song. You give a search term or a link.
- The bot resolves it. It searches a catalog or reads the link to find a playable audio stream.
- It joins voice. The bot connects to your voice channel. Discord allows a bot to be in only one voice channel per server at a time.
- It streams. Audio is decoded, adjusted for volume, re-encoded with the Opus codec) that Discord voice uses, and sent as a live stream.
- It manages the queue. When a track ends, the bot starts the next one.
Streaming means the bot doesn't need to keep a library of files. Some bots download or cache tracks first, others read the stream as it plays.
Where does the music come from?
This is the part that most often decides whether a bot works well. A bot needs a source: a service it's allowed to fetch audio from. Different bots use different sources, such as open or artist-friendly platforms, or services with public catalogs. Sources can change their rules or block automated access, which is why a bot that worked last month can suddenly fail on certain links.
A few practical points:
- Direct links from a supported service play as-is.
- Search terms are matched against the sources the bot checks, usually in a fixed order.
- Links from unsupported services are often read only for the title and artist, then searched elsewhere, so the version you hear may differ from the one you linked.
How do music queues work?
A queue is an ordered list of upcoming tracks. Typical features:
- Add / remove: append a track or take one out by position.
- Skip and stop: move to the next track, or clear everything and leave.
- Shuffle: randomize the order of upcoming tracks.
- Loop: repeat the current track or the whole queue.
- Seek and volume: jump to a time in the track and adjust loudness.
Most bots also set a maximum queue length so one person can't add an unlimited playlist.
Slash commands vs prefix commands
Music bots historically used prefix commands like !play. Many now support slash commands as well. See slash commands vs prefix commands for how they differ.
Common problems and fixes
- Bot joins but is silent. Check it has Connect and Speak permissions in that voice channel; see how Discord permissions work.
- Audio stutters. Usually a network or host issue on the bot side, or a very busy voice region.
- A link won't play. The source may be unsupported or blocked. Try searching the song name instead.
- Controls don't respond. Many bots require you to be in the same voice channel, or hold a DJ role.
Doing this with Based
Based's /play takes a song name or link and streams it in voice; nothing is downloaded or cached. Song names are searched on JioSaavn first, then SoundCloud, then Audius. JioSaavn, SoundCloud and Audius links play directly. Spotify, Apple Music and YouTube links are read for the title and artist and then searched. Playlists and albums are queued up to the queue limit, which defaults to 100.
Controls live in one player panel with buttons for pause, skip, stop, seek by 15 seconds, volume, loop, shuffle and queue. The matching commands are /pause, /resume, /skip, /stop, /queue, /playing, /volume, /seek, /remove, /shuffle, /loop and /clearqueue. An optional DJ role can restrict who controls playback. Based pauses when no human is listening and leaves after two minutes alone or three idle minutes. Every slash command also works with the "." prefix, such as .play. More in the music docs and the music feature page.
Frequently asked questions
Do Discord music bots download songs?
It depends on the bot. Many stream audio as it plays, and some cache files. Based streams and doesn't download or cache tracks.
Why can't I play a Spotify link directly?
Spotify doesn't hand out playable audio to bots. Bots that accept Spotify links usually read the title and artist and then find the song on another source, so the version may differ.
Why is my music bot not making sound?
The most common causes are missing Connect or Speak permission, the bot being in a different voice channel, or a source that is blocked. Check permissions first.
Can a bot play in two voice channels at once?
Not within one server. Discord limits a bot to one voice connection per server at a time.
Keep learning
- Discord basics
What is a Discord bot?
A Discord bot is an automated account that runs code to respond to commands and events. Learn how bots work, what they do and how they differ from users.
- Discord basics
Slash commands vs prefix commands on Discord
Slash commands are built into Discord; prefix commands are typed messages like !help. Compare how they work, their trade-offs and which to use.
- Discord basics
How Discord permissions work
Discord permissions control what members and bots can do. Learn how role permissions combine, what Administrator does and how to fix common issues.
- Voice and media
What are temporary voice channels on Discord?
Temporary voice channels are Discord rooms created on demand and deleted when empty. Learn how join-to-create works and how to set it up.
- Voice and media
How do voice AI assistants work?
How voice AI assistants work: speech recognition, a language model and text-to-speech, versus newer speech-to-speech models, and why latency matters.
Try it in your server
Based is an AI Discord bot in 300+ servers. Every slash command also works with the "." prefix.