
Text to speech Discord bot which used the deprecated Lyrebird API.
This bot was designed to work with Heroku, with separate web and worker applications to prevent the bot from going offline. This functionality required a MongoDB database to store authorized voices and communicate between the applications.
Alternatively, the combined version of this bot did not require setting up a database, but could only be run on a server with persistent storage. Heroku's storage is cleared every time the application is restarted. I never finished the combined version, so it is missing some features present in the separated version.
lyre_addvoice
Registers your voice to be used with lyre_say and lyre_share.
Your voice can only be used on the guild this command was run on.
lyre_say
Generates speech using your voice, registered with lyre_addvoice.
If the bot is in a voice channel, the speech will play through this channel.
If not, the speech will be sent as an attachment.
lyre_share
Creates a command through which others in your guild can generate speech using your voice.
This command will function identically to lyre_say, except others in your guild can use it.
lyre_join
Joins the voice channel you are currently in.
lyre_leave
Leaves the voice channel.
lyre_saytoken
Generates speech using a Lyrebird token provided directly.
This command does not require a database, but is not recommended as others can see your token.
Create your voice.
Set the environment variable LYRE_REDIRECT_URI to your computer's address. Locally, this will be http://localhost:8080. This is used for authorization.
Create your Lyrebird app. Make sure Redirect URI matches LYRE_REDIRECT_URI.
Set the environment variables LYRE_CLIENT_ID and LYRE_CLIENT_SECRET from the website.
Create your Discord app with a Bot.
Set the environment variable DISCORD_BOT_TOKEN from the website.
Go to https://discordapp.com/oauth2/authorize?client_id=<CLIENT_ID>&scope=bot, with <CLIENT_ID> as your Discord app's client ID.
Install Node.js: brew install node
Install FFmpeg: brew install ffmpeg
Install the dependencies: npm install
Run the bot: npm start
Hope it works!