User Tools

Site Tools


musicbot

๐ŸŽต Discord Music Bot โ€“ Installation & Usage

This bot plays ambient lo-fi music automatically in your Discord voice channel. It starts with shuffle, continues playing without stopping, and can be controlled via simple commands.

๐Ÿ“ฆ Requirements

  • Python 3.10 or newer
  • FFmpeg installed (`sudo apt install ffmpeg`)
  • A Discord Bot Token
  • MP3 files placed in the `music/` directory
  • Optional: systemd for autostart on boot

๐Ÿ› ๏ธ Installation

  • Clone or copy the bot code into a directory, e.g. `/var/www/mbot/`
  • Create a `music/` folder and add your MP3 tracks
  • Install required Python packages:

`pip install discord`

๐Ÿ” Insert Your Bot Token

Open `.env` and replace:

`your-bot-token-here`

with your actual Discord bot token.

๐Ÿค– Creating a Discord Bot

  • Click New Application, give it a name
  • Go to Bot tab โ†’ click Add Bot
  • Under Privileged Gateway Intents, enable:
    1. Message Content Intent
    2. Server Members Intent
  • Copy the token and paste it into `bot.py`

๐Ÿ”— Invite the Bot to Your Server

Go to the OAuth2 โ†’ URL Generator tab:

  • Scopes: `bot`
  • Bot Permissions:
    1. Connect
    2. Speak
    3. Send Messages
    4. Read Message History

Copy the generated URL and open it in your browser to invite the bot.

๐Ÿš€ Bot

Now available on github!

discord-musicbot

musicbot.txt ยท Last modified: by miko

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki