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...
Invite the bot to your server or just DM it.
Use !help
to get help in Discord.
!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)
!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
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')
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
.
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"
}
- 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