Skip to content

Latest commit

 

History

History
178 lines (114 loc) · 4.8 KB

File metadata and controls

178 lines (114 loc) · 4.8 KB

Setup Guide

This guide covers the normal non-Docker setup path and the main configuration points that matter on this fork.

Prerequisites

  • Java 11 or newer
  • A Discord bot token
  • A Discord application with the bot invited to your server

Discord Setup

  1. Create a bot in the Discord Developer Portal.
  2. Copy the bot token.
  3. Enable the MESSAGE_CONTENT intent.

This intent is required for command-based bots like this one.

Privileged Intent Notes

This fork moved from JDA 4 to JDA 6, so MESSAGE_CONTENT is now an important operational requirement for the classic text-command flow.

Keep in mind:

  • If the bot joins more than 100 servers, this intent must be enabled in the Discord Developer Portal.
  • MESSAGE_CONTENT is a privileged intent.
  • Discord verification requirements become relevant as the bot grows.
  • The related portal controls historically only become visible once the application is already in a fairly large number of servers.

For the broader Discord/JDA behavior, see the JDA gateway intents documentation.

First Configuration

The bot reads from config.txt using the values defined in reference.conf.

The minimum settings you should care about first are:

token = "YOUR_BOT_TOKEN"
owner = 123456789012345678
prefix = "@mention"

Useful fork-specific options:

youtubeoauth2 = true
statusmessages = true
dblog.enabled = false

You may also need these for YouTube PO token support:

ytpotoken = "PO_TOKEN_HERE"
ytvisitordata = "VISITOR_DATA_HERE"

Running The Bot

Build:

mvn clean package

Run:

java -jar target/JMusicBot-*-All.jar

This fork includes changes to keep source builds practical on the newer stack as well.

YouTube Login

If YouTube playback is unreliable, enable:

youtubeoauth2 = true

After startup, the bot prints instructions and sends the owner a DM with the authorization flow.

Important:

  • Do not use your main Google account.
  • Use a burner or otherwise disposable account.

If you are starting from a clean config, this option should already exist with a default of false.

YouTube PO Tokens And Visitor Data

This fork also supports explicit YouTube PO token and visitor-data configuration.

Config:

ytpotoken = "PO_TOKEN_HERE"
ytvisitordata = "VISITOR_DATA_HERE"

You can generate these values with:

This is useful when normal YouTube playback is not enough and you need a more explicit trusted-session style setup.

DAVE / Voice Support

This fork includes DAVE support for current Discord voice requirements. In normal supported environments, nothing extra is required beyond using the provided shaded jar.

If you run on an unsupported architecture, add the correct native libdave-jvm dependency in pom.xml.

Bundled native targets include:

  • Linux glibc x86_64
  • Linux musl x86_64
  • Windows x86_64
  • macOS

Status Messages

The bot can maintain a single playback status message in the active text channel.

Config:

statusmessages = true

Disable it with:

statusmessages = false

Analytics Logging

Playback analytics logging is off by default.

Enable SQLite logging:

dblog.enabled = true
dblog.jdbc_url = "jdbc:sqlite:musicbot.db"

This creates a local SQLite database file and records queue, playback, listener, and command activity.

When analytics are enabled, the stats command can show server, personal, track, source, and skip reports:

stats server month
stats me week source:youtube
stats track
stats tracks 60d limit:20 userlist:[alice,bob]
stats listened 1y users:alice
stats reports set #music-stats monthly
stats reports now 2026-04
stats reports now 2025

Personal member reports are self-only unless the requester has Manage Server. Scheduled reports are Discord embeds; graphic rewind images are not generated yet.

Windows Note

If you run the bot directly on Windows rather than in Docker, install Java first and consider a service wrapper such as NSSM if you want it to run in the background.

Related Fork Context

This fork incorporates or builds on work related to:

  • PR-1670 for YouTube account login support
  • PR-1703 for source builds
  • PR-1772 for YouTube PO token and IP rotation work

If this fork does not fit your setup, another fork you may want to inspect is SeVile/MusicBot.