A simple text to image discord bot written in python using OpenAI DALL-E 2 model
- You will need to get your free OpenAI and Discord API keys in order for this bot to work. Create your Discord bot and copy the application token from here. Paste the value into the
tokenvariable in the script. - Next create an account at OpenAi.com this step will require a phone number. After you have made your account copy your API key and Organization ID into the
ai.api_keyandai.organizationvariables.
- Discord-py (2.2.1):
pip install discord-pydocs - OpenAI (0.26.5):
pip install openaidocs - aiohttp (3.8.4):
pip install aiohttpdocs
Add your Discord bot to your server making sure you have given it the necessary privileges (i.e message content, send messages, embed links, attach files) and Run the bot in any terminal with python Txt2Img-DiscordBot.py
If you are planning on deploying this script you might want to consider setting up environment variables to store your keys rather than having them in the script source code.
