The Discord bot is designed to interact with users in a voice channel. Upon joining a voice channel, the bot is capable of listening to users' spoken words and processing them as text. The bot utilizes voice recognition software to transcribe the speech into text, and then passes the text to ChatGPT for generating a response.
Table of Contents
- Get a Discord Bot Token Discord Bot Token Guide
- Get an OpenAI API Key at OpenAI API
- Clone the repo
git clone https://github.com/moo-gn/VoiceBot.git
- Install requirements using Pip
pip install -r requirements.txt
- Enter your API keys in
credentials.pyDISCORD_BOT_TOKEN = "ENTER DISCORD TOKEN HERE" OPENAI_API_TOKEN = "ENTER OPENAPI KEY HERE"
- Run the main driver
python3 voice_bot.py
- Command the bot to join the voice channel using
/join
- Click the 🔴 button to start recording your prompt
- Click the ⬜ button to stop recording
- Find your response in the text channel you asked the bot to join from
- Command the bot to leave the voice channel using
/leave
Here is an example where I asked the the voice bot for a pasta recipe!
- Have the option to convert the ChatGPT text response back to speech using text-to-speech synthesis and play the response in the voice channel.
- Add voice commands.
- Make interface more user friendly. For example, remove record button and only stop recording when we are in the recording phase
- Improve the messages displayed to the user. Add the option to view the prompt recorded
- Make the user have the ability to change the join/leave commands to words of their choosing
Distributed under the MIT License. See LICENSE.txt for more information.
Ghaith Khoja - gkhoja@umich.edu
Project Link: https://github.com/moo-gn/VoiceBot.git