This Discord bot allows users to talk in a voice chat without the use of a microphone. With the use of a Text to Speech service such as IBM Watson, it's possible to convert a Discord user's text messages to speech. Integrated into the project is OpenAI's chatbot solution that allows users to have realistic conversations via Voice & Text.
These steps will get you up and running as soon as possible.
General installation:
Follow these steps to install the bot regardless of your platform.
pip install -r requirements.txt command in a terminal window. This will install all of the needed Python libraries that are listed in the requirements.txt file.main.py file:
bot_prefix: Changing this is optional, but you can change your Discord bot's prefix if you wantDISCORD_TOKEN: Your Discord bot's token
IBM_WATSON_API_KEY: Your IBM Watson Text to Speech service API key
IBM_WATSON_URL: Your IBM Watson Text to Speech service API URL
IBM_WATSON_DEFAULT_ACCENT: Changing this is optional, but you can change your Discord bot's default accentDISCORD_BOT_ID: Your Discord bot's ID
user_ids and channel_ids variables accordingly.Windows-specific:
If you're on Windows, follow these additional steps in order to get the bot's voice chat module to run:
version variable in the main.py file by changing its value to "W" for "Windows".Run the following command in a terminal window: python main.py
or
Double click the run.bat file, which runs the python main.py command on its own. Please note that you'll have to edit the bat file accordingly if you change the script's name.
Linux-specific:
If you're on Linux (most likely because you'd like to host the bot on a server), follow these additional steps in order to get the bot's voice chat module to run:
version variable in the main.py file by changing its value to "L" for "Linux".sudo apt install ffmpegpython main.pyNow that you've successfully completed the installation process, you're ready to start using the bot! Assuming you've already invited it to one of your servers and you've got enough permissions to use it, you can run a couple of commands to get started.
If you're already in a voice channel:
.join (or "PREFIXjoin" if you've decided to change the bot's prefix) in any text channel - this will tell the bot to join the voice channel you're currently in..leave (or "PREFIXleave" if you've decided to change the bot's prefix) if you want the bot to leave the voice channel it's currently in. This will also reset it and delete all of the MP3 files that it used during the session.If you're not in a voice channel:
.join CHANNEL_ID (or "PREFIXjoin CHANNEL_ID" if you've decided to change the bot's prefix) in any text channel - this will tell the bot to join the voice channel you're specified in the command..leave (or "PREFIXleave" if you've decided to change the bot's prefix) if you want the bot to leave the voice channel it's currently in. This will also reset it by deleting all of the MP3 files that it used during the session and change its accent to the default one.Additional commands:
.accents (or "PREFIXaccents") command. This will return a list of accents as shown in the following screenshot:
.accent ACCENT (or "PREFIXaccent ACCENT") command, as shown in the screenshot below. Please note that the command must be taken from the list of accents generated from the .accents (or "PREFIXaccents") command.
Project demo:
This YouTube video showcases a complete project demo with audio recorded by one of our users: