Git Product home page Git Product logo

lyrical's Introduction

lyrical

A simple Discord bot that is capable of playing music in voice channels and running polls. This was a project I did in order to learn Golang, so if you see anything unidiomatic here it's probably because I really lacked the experience to write good Go code. Nevertheless, I did try to keep test coverage high and it seems like the features behave pretty well.

Installation

Dependencies

sudo apt-get install ffmpeg --yes

Architecture specific

Build the bot for the architecture that you desire.

env GOOS=linux GOARCH=arm go build -o builds/discordbot .

Config file

It is necessary to have a configs/config.json file, a sample file can be found at configs/config.json.example

Run

./builds/discordbot

Deployment

In order to facilitate rapid prototyping, i.e. painless deployment to my server, I chose to make use of a Ruby tool called Capistrano to handles deployment to a server. All it does is run SSH commands on remote servers.

In short, we can also define diffent deployment steps based on the environment. Deployment can be done as so depending on the environment.

# deploy to the staging environment
$ bundle exec cap staging deploy

# deploy to the production environment
$ bundle exec cap production deploy

How does music playback work?

Members of the server will be able to use commands to add songs 1-by-1 to the playlist of the bot. The songs will be downloaded by the bot from Youtube, and the song will added to a sqlite database. The bot will maintain a queue of songs to play based on requests from members. Once all user requested songs have been played, playback will continue by selecting random songs to play from the pool of songs previously requested by members.

Other tools

I also wrote a CLI tool to allow adding music in bulk to the playlist of the bot, it can be found in ./cmd/bulk-music-insert. Given an ID of a Youtube playlist, it will download a certain number of songs from it and add it to the bot's music pool, i.e. adding it to the sqlite database.

lyrical's People

Contributors

jamestjw avatar

Stargazers

Rob Schneider avatar Ali avatar

Watchers

James Cloos avatar

lyrical's Issues

Failed to get video info

I just cloned the repo and put discord token and ytAPI on config but I face this error when I add something to the playlist.
image

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.