Git Product home page Git Product logo

xypwn / go-musicbot Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 39 KB

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. Mirror of https://git.nobrain.org/r4/go-musicbot.

License: GNU General Public License v3.0

Go 100.00%
golang discord-music-bot mirrored-repository go discord-bot

go-musicbot's Introduction

!!! Repo archived since I have rewritten the bot: https://github.com/xypwn/dischord !!!


go-musicbot

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) 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.

  • Make sure to have ffmpeg installed (basically every Linux/BSD distro should have a package for it).

  • Make sure to have a RECENT version of youtube-dl. 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.

Notes

  • 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".

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.

  • Make youtube-dl executable chmod +x ./youtube-dl.

  • 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".

  • Save and you're done. The bot should now look for youtube-dl locally instead of system-wide.

go-musicbot's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.