This repository has been archived on 2022-09-20. You can view files and clone it, but cannot push or open issues or pull requests.
go-musicbot/README.md

50 lines
2.1 KiB
Markdown
Raw Permalink Normal View History

2022-09-20 01:23:43 +02:00
# !!! Repo archived since I have rewritten the bot: [https://github.com/xypwn/dischord](https://github.com/xypwn/dischord) !!!
---
2021-07-28 17:26:21 +02:00
# go-musicbot
2021-07-28 18:02:58 +02:00
A lightweight Discord music bot written in go with minimal dependencies.
Optimized for low CPU (not RAM) usage and responsive playback.
Directly uses youtube-dl and ffmpeg for downloading media.
## Building from source
- Make sure to have [Go (Golang)](https://golang.org) installed.
- Clone the repo: `git clone 'https://git.nobrain.org/r4/go-musicbot.git' && cd go-musicbot`.
- Let Go install all library dependencies: `go mod tidy`.
- Build the program: `go build`.
## Running the binary
- Run the binary once to generate `config.json`: `./dcbot`.
2021-07-28 18:28:20 +02:00
- Make sure to have [ffmpeg](https://ffmpeg.org/) installed (basically every Linux/BSD distro should have a package for it).
2021-07-28 18:02:58 +02:00
- Make sure to have a **RECENT** version of [youtube-dl](https://yt-dl.org/). If your distro doesn't package a recent version, see the section titled "Obtaining a recent youtube-dl binary".
- In `config.json`, find the line that says `"token"`. In that line, change the text that says `"insert your discord bot token here"` to whatever your bot token is (just look it up if you don't know how to get one). Remember to keep the `""` sorrounding the token.
2021-07-28 18:28:20 +02:00
## Notes
2021-07-28 18:42:34 +02:00
- youtube-dl might cause some problems with certain Unicode characters if the locale isn't configured correctly (messages like "Adding 0 tracks to queue." may arise). Quick fix: `sudo sh -c "echo 'LC_ALL=\"en_US.UTF-8\"' >> /etc/environment"`.
2021-07-28 18:28:20 +02:00
2021-07-28 18:02:58 +02:00
## Setup
### Obtaining a recent youtube-dl binary
Some distributions like Debian don't ship a very recent version of youtube-dl, but there is a simple solution for running this bot nonetheless.
- Locally download the latest youtube-dl version **into the cloned repo**: `wget https://yt-dl.org/downloads/latest/youtube-dl`.
2021-07-28 18:06:56 +02:00
- Make youtube-dl executable `chmod +x ./youtube-dl`.
2021-07-28 18:02:58 +02:00
- In `config.json`, look for the line that says `"youtube-dl_path"`. In that line, change the value that says `"youtube-dl"` to `"./youtube-dl"`.
2021-07-28 18:28:20 +02:00
- Save and you're done. The bot should now look for youtube-dl locally instead of system-wide.