A Discord bot that uses the OpenAI API to generate text and images based on user prompts.
This Discord bot allows users to interact with the OpenAI API using two commands: /askMc for generating text responses and /drawMc for generating images.
-
AskMc Command: Use
/askMcfollowed by a question to get a text response generated by the OpenAI engine using "text-davinci-002" model. -
DrawMc Command: Use
/drawMcfollowed by a prompt to generate an image using Dall-E 2 model .
/askMc Write a short description about Algeria
/drawMc a notebook on a dark room under the sun rays- Clone this repository:
git clone https://github.com/ghanoubrk/Discord-Bot-using-OpenAI-API
- Install dependencies :
pip install -r requirements.txt
- Create
.envfile on your project folder and add on it your discord token and your OpenAI API key :discord_token=YOUR_DISCORD_TOKEN openAi_key=YOUR_OPENAI_API_KEY
- Run the bot :
python bot.py
Contributions are welcome, If you want to contribute don't hesitate