A music bot for Discord, built with Go.
  • Go 96%
  • Nix 4%
Find a file
2026-03-08 15:22:47 -05:00
cmd/thischord fix: bad imports 2026-01-20 17:17:25 -06:00
internal fix: libdave requirement & bots responding to out of guild messages 2026-03-08 15:22:47 -05:00
samples dev(nix): make flake for project; rename samples 2026-01-20 15:14:30 -06:00
.envrc dev(.envrc): move use flake placement 2026-01-20 15:43:02 -06:00
.gitignore dev(nix): make flake for project; rename samples 2026-01-20 15:14:30 -06:00
flake.lock dev(nix): make flake for project; rename samples 2026-01-20 15:14:30 -06:00
flake.nix dev(nix): make flake for project; rename samples 2026-01-20 15:14:30 -06:00
go.mod fix: libdave requirement & bots responding to out of guild messages 2026-03-08 15:22:47 -05:00
go.sum fix: libdave requirement & bots responding to out of guild messages 2026-03-08 15:22:47 -05:00
LICENSE dev: add LICENSE 2025-12-07 20:39:59 -06:00
README.md Update README.md 2026-01-20 22:32:46 +01:00

,--------.,--.     ,--.        ,-----.,--.                      ,--. 
'--.  .--'|  ,---. `--' ,---. '  .--./|  ,---.  ,---. ,--.--. ,-|  | 
   |  |   |  .-.  |,--.(  .-' |  |    |  .-.  || .-. ||  .--'' .-. | 
   |  |   |  | |  ||  |.-'  `)'  '--'\|  | |  |' '-' '|  |   \ `-' | 
   `--'   `--' `--'`--'`----'  `-----'`--' `--' `---' `--'    `---'  

A Discord music bot hoping to act as a comparable replacement for jMusicBot, built with Go.

This is meant to be self-hosted and can support 1 guild per instance.

Summary

  1. Prerequisites
  2. Features
  3. Missing Features
  4. Planned Additions
  5. Making a Discord Application
    1. General Information
    2. Installation
    3. Bot
  6. Getting Started with Lavalink
    1. Installing Lavalink
    2. Setting up Lavalink as a Service
    3. Configuring Lavalink
  7. Getting Started with ThisChord
    1. Installing ThisChord
    2. Setting up ThisChord as a Service
    3. Configuring ThisChord
  8. Starting the Music Bot

Prerequisites

Features

  • Search for music on YouTube
  • Play music from YouTube by search query or URI
  • Add additional songs into a queue
  • Skip songs
  • Shuffle the queue
  • Clear the queue
  • See what's playing, and the position of the seeker
  • Stop & pause playback

Missing Features

  • Ability to repeat:
    • tracks
    • queues
  • Loading playlists from YouTube
  • Additional music sources:
    • SoundCloud
    • Bandcamp
    • Vimeo
    • Premium services like:
      • Spotify
      • Apple Music
      • Deezer

Planned Additions

  • YAML or JSON config instead of using .env file
  • Ability to run w/ Docker
  • CI/CD integration
  • Return custom embeds instead of plain old text responses:
    • Now Playing:
      • media control buttons
      • seeker progression
      • added by
      • art (cover/album art)
    • Searching
    • Skipping
    • etc.

Making a Discord Application

First, we want to navigate to the Discord Developer Portal and click New Application in the top right, then proceed with editing the following sections.

General Information

We don't really need to change anything here unless you decide to change the name of the application.

Installation

Check Guild Install only, and ensure the scope has applications.commands and bot in it, then add the following permissions:

  • Add Reactions
  • Connect
  • Embed Links
  • Priority Speaker
  • Read Message History
  • Request To Speak
  • Send Messages
  • Send Messages in Threads
  • Speak
  • Use Slash Commands
  • Use Voice Activity
  • View Channels

Tip

You'll use the URL found under Install Link to invite the bot to your server.

Bot

Here, give your bot an optional profile picture, and a username. Ensure the following are enabled:

  • Public Bot
  • Presence Intent
  • Server Members Intent

Tip

This is where you'll also get your bot token, under the Token section of this page.

Please follow the official Lavalink documentation here

Please follow the official Lavalink documentation on creating a systemd service here

Lavalink needs a bit of additional configuration before we can use it with YouTube. You'll want to create a file called application.yml in the directory with Lavalink.jar - I recommend copying the sample and changing the password to your liking.

Getting Started with ThisChord

Installing ThisChord

Important

Please ensure you have Go 1.25.1+ on your machine; installation instructions can be found here

To install ThisChord, run the following in your terminal, which will output the binary file to $GOBIN

$ go install codeberg.org/eleina/thischord/cmd/thischord@latest

Tip

Either export GOBIN in your shell profile, or run go env -w GOBIN=/path/to/some/bin

Setting up ThisChord as a Service

Create a file in /etc/systemd/system named thischord.service with the following:

[Unit]
Description=ThisChord Music Bot
After=lavalink.service syslog.target network.target
Requires=lavalink.service

[Service]
User=BOT_USER # replace this with the user you run the bot as, i.e. bot
Group=BOT_GROUP # replace this with the user's group you run the bot as, i.e., bot
WorkingDirectory=/path/to/bin/with/bot # i.e. /home/bot
ExecStart=/path/to/bin/with/bot/thischord # i.e /home/bot/thischord
Restart=on-failure
RestartSec=5s


[Install]
WantedBy=multi-user.target

Configuring ThisChord

Navigate to $GOBIN, or wherever you placed the thischord binary, and create a .env file. I recommend copying the sample and filling it in with details specific to your instance and Discord guild.

Starting the Music Bot

Important

Please ensure you have yt-dlp and ffmpeg installed before starting the bot.

You'll want to reload the systemctl daemon:

$ sudo systemctl daemon-reload

and then enable & start both the Lavalink and ThisChord services:

$ sudo systemctl enable --now lavalink.service
$ sudo systemctl enable --now thischord.service

Lastly, let's make sure things are running smoothly. Run the following commands to ensure everything started properly:

$ systemctl status lavalink.service
$ systemctl status thischord.service

That should be all! You now have a music bot for your server! Make sure to periodically check this repo for updates!