This project consolidates multiple Discord bots using the Gemini API into a single, modular Python application.
- Copy
.env.exampleto.envand fill in your Discord bot tokens and Gemini API key. - Install dependencies:
pip install -r requirements.txt - Run the project:
python main.py
main.py: Central runner for all bots.cogs/: Contains each bot's logic as a separate Cog..env.example: Template for required environment variables.requirements.txt: Python dependencies..gitignore: Ignores Python/VSCode/secret files.
- Push your code to a GitHub repository.
- Go to Render.com and create a free account (or log in).
- Click "New Web Service" and connect your GitHub repo.
- For the build command, use:
For the start command, use:
pip install -r requirements.txtpython main.py - Add all required environment variables in the Render dashboard (see
.env.examplefor the full list). Do not upload your.envfile. - Click "Create Web Service". Render will build and deploy your bot. It will restart automatically if it crashes or if you push new code.
Note:
- Render's free plan will sleep after 15 minutes of inactivity. For 24/7 uptime, consider a paid plan.
- Do not commit your
.envfile or any secrets to version control. Use Render's environment variable settings instead.