Skip to content

πŸ”Š Creating raps and playing them through Discord

Notifications You must be signed in to change notification settings

wrussell1999/rap-god-discord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

42 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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

About

πŸ”Š Creating raps and playing them through Discord

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages