This project demonstrates how to build a Discord bot that generates images from text prompts using the Prodia API, while utilizing Daytona for an optimized and scalable development environment. With Daytona's devcontainers, the bot ensures a standardized, fast, and efficient setup process.
Table of Contents
π Getting Started
1. Install Daytona
First, make sure you have Daytona installed. You can follow the installation guide from the Daytona documentation.
Start the server
daytona serve;
2. Clone the Repository
Clone this repository to your local machine:
git clone https://github.com/TheCoderAdi/discord-bot.git
cd discord-bot
3. Create a Daytona Workspace
Create a development workspace using Daytona:
daytona create https://github.com/TheCoderAdi/discord-bot
4. Install Dependencies
Once you have set up your workspace, ensure all dependencies are installed by running:
pip install -r requirements.txt
5. Configure the Bot
Create a .env
file in the root directory of the project and add your Discord bot token and Prodia API key as follows:
DISCORD_TOKEN=your_discord_bot_token
PRODIA_API_KEY=your_prodia_api_key
6. Run the Bot
After configuring the bot, you can start it by running:
python bot.py
This will start the bot, which will listen to messages on your Discord server and respond with generated images based on text prompts.
β¨ Features
Integration with Daytona:
Daytona ensures a consistent, reproducible development environment with devcontainers for easy setup and scaling.Modular Python Bot Framework:
The bot is designed to be modular and extendable. You can easily add new features or commands.Discord API Integration:
Uses the Discord API to handle real-time message interaction in the server.Image Generation with Prodia API:
Generates images based on text prompts, utilizing the Prodia API to create AI-driven images.
π¬ How to Use
Once the bot is up and running, you can interact with it directly in any Discord channel where the bot is present.
1. Text Prompt Command
To generate an image, use the command !generate
followed by the text prompt. For example:
!generate A sunset over a mountain range
The bot will process your request and return the generated image. The output will be displayed in the channel like so:
Output Image:
The bot will send back the image in the Discord channel once the image generation is completed.
π License
This repository is licensed under the MIT License. See the LICENSE
file for more details.
π Learn More
- For more information on Daytona, visit the official Daytona documentation.
- For more on Discord bot development, check out the Discord.py documentation.
Top comments (0)