Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

discord-python-bot

Discord bot that plays a live Icecast / AzuraCast stream in a voice channel, tracks ICY metadata, and looks up album info.

Formerly discord-icecast-bot.

Features

  • !play — join your voice channel and stream
  • !stop — stop and disconnect
  • !song — current title, Genius search link, MusicBrainz album art when available
  • !history — recent titles (paginated)
  • Auto-leaves when the channel is empty (idle timeout)
  • Presence shows the current track

Requirements

  • Python 3.10+
  • FFmpeg on PATH (needed for voice)
  • A Discord bot token with Message Content Intent enabled
  • A public stream URL (listen mount only — never put admin API keys in the bot)

Setup

python3 -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# edit .env — DISCORD_TOKEN + STREAM_URL
python -m bot

Discord portal

  1. Create an application → Bot → copy token → DISCORD_TOKEN
  2. Enable Message Content Intent
  3. OAuth2 URL Generator → bot scope → permissions: Connect, Speak, Send Messages, Embed Links
  4. Invite the bot to your server

.env

Variable Required Description
DISCORD_TOKEN yes Bot token
STREAM_URL yes Public Icecast/AzuraCast listen URL
COMMAND_PREFIX no Default !
STREAM_VOLUME no 0.0–1.0 (default 0.5)
IDLE_TIMEOUT_SECONDS no Leave empty channel after N seconds (default 300)
HISTORY_SIZE no Titles kept for history (default 50)
MUSICBRAINZ_USER_AGENT no Identify your bot for the MB API

Notes

  • Stream must expose ICY metadata (icy-metaint) for !song / presence updates.
  • MusicBrainz asks for a real User-Agent with contact info — set MUSICBRAINZ_USER_AGENT.
  • This is a client of a public mount. Do not ship station admin passwords or private relay URLs.

License

MIT

About

Discord bot that streams Icecast/AzuraCast audio into voice channels

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages