Ensure you have the following before setup:
- Discord Token: Obtain from the Discord Developer Portal.
- Node.js: Version 20 or higher. Download here.
- NPM: Comes with Node.js.
- FFmpeg or Avconv: Required for media transcoding. Download FFmpeg or install via npm:
npm i ffmpeg-static
- DISCORD_TOKEN: Bot token for Discord API.
- CLIENT_ID: Bot application ID to register slash commands.
- DEV_GUILD: ID of the development server.
- DEV_IDS: Comma-separated list of developer IDs.
- SUPPORT_SERVER: Link to the discord support server. (Required, for youtube support)
- YT_CREDENTIAL: Youtube authentican credentials
- Signing into YouTube
npx --no discord-player-youtubei
- Follow the guide in terminal and login using google account. Make sure you are using a throwaway account to login. Using your main account may result in ban or suspension.
- The token will be printed out shortly.
- Note down the credential string.
- Create
.env
File: In the root directory, create.env
. - Use
.env.sample
: Copy and replace placeholders with your values. - Save as
.env
: Ensure all variables are correctly filled.
- Clone the Repository:
git clone https://github.com/LakhindarPal/discord-player-bot && cd discord-player-bot
- Install Dependencies:
npm install
- Fill the
.env
File: Ensure all configurations are set as describe above. - Register Slash Commands:
npm run register
- Run the Bot:
npm start
- Fill the
.env
File: Ensure all configurations are set as described above. - Pull Docker Image:
docker pull lakhindarpal/discord-player-bot:latest
- Run Docker Container:
docker run --env-file .env lakhindarpal/discord-player-bot:latest
- Register Slash Commands:
docker exec -it <container_id> npm run register