This Discord bot integrates with OpenAI's API to provide dynamic responses based on user commands. It generates answers, explanations, and even images based on prompts provided in the Discord chat.
A few features I have implemented in this project are:
- Dynamic Response Generation: Leverages OpenAI's powerful models to generate responses.
- Multiple Commands: Includes commands like
ask
,emoji
,coding
,speak
,explain
, andgenerate
to interact with OpenAI's models. - Text to Speech: Converts text to speech for an interactive experience.
- Speech Explanation: Provides speech explanation for given prompt
Follow the instruction below to install and run the discord bot on your system:
- Clone the project into your system
git clone https://github.com/manishacharya60/discord-samsaraGPT.git
- Navigate to the bot directory and run the following command to install required dependencies
$ pip install -r requirements.txt
- Create a new
.env
file and set up environment variablesOPENAI_API_KEY: <Your OpenAI API key> DISCORD_TOKEN: <Your Discord bot token>
- Then, run one of the following command to run the bot
$ python bot.py $ ./startup.sh
- Open your discord and test the bot
After inviting the bot to your Discord server, use the following commands:
- !ask [question]: Generates a response from OpenAI
- !emoji [text]: Converts text to emojis
- !coding [prompt]: Generates a coding problem
- !generate [prompt]: Creates an image based on the prompt
- !speak [prompt]: Converts the given text into speech
- !explain [prompt]: Generates the text explanation for the given question