Coder Social home page Coder Social logo

rap-god-discord's Introduction

Rap God - Discord Edition

Rap God was a pretty cool hackathon project, built using the Nexmo API. I thought it would be cool to implement the same thing, but inside of Discord using voice channels...

Usage

Invite the bot to your server or just DM it. Use !help to get help in Discord.

In servers
  • !rap <word(s)> make a rap with the given words and play it in a voice channel
  • !lyrics <words(s)> make a rap with the given words and just print it
  • !save save the last rap played and upload it as an mp3

Server admin-only commands:

  • !voice_channel <name of voice channel> set which voice channel raps should be played in
  • !lyrics_channel <name of text channel> set which text channel the !lyrics command is allowed to be used allowed in (to reduce spam)
In a DM chat with the bot
  • !rap <word(s)> make a rap with the given words and upload it as an mp3
  • !lyrics <words(s)> make a rap with the given words and just print it

Setup Environment

Requires Python 3.6.7 or above.

$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip3 install -r requirements.txt

Requires command line application ffmpeg or avconv to load the backing tracks.

Then following python needs to be run to get the natural language data sets:

import nltk
nltk.download('punkt')
nltk.download('averaged_perceptron_tagger')

Configuration

Google Cloud Platform credentials

Follow this guide to get GCP text-to-speech working. Put the JSON file in the config folder and name it google_cloud_key.json.

Discord credentials

Follow this guide to get a Discord bot setup on your server.

config/discord.json

{
    "token": "<bot token goes here>",
    "thread_count":4,
    "command_prefix":"!"
}

config/songs.json

{
  "artist name":"song name or * for all songs"
}

Contributors

  • Will Russell: Discord bot, text to speech with GCP, and mp3 layering.
  • Justin Chadwell: Natural language processing and lyric generation.
  • Daniel Spencer: Improving audio generation, adding features and making the bot scalable to multiple servers

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.