- Create a new Web Service on Render
- Connect your GitHub repository
- Configure the following settings:
- Name: study-bot (or your preferred name)
- Environment: Python 3
- Build Command:
pip install -r requirements.txt - Start Command:
python bot.py
Set these in Render's environment variables section:
DISCORD_TOKEN- Your Discord bot tokenGEMINI_API_KEY- Your Gemini API key (optional)TZ- Set to your timezone (e.g., 'Asia/Kolkata')PORT- Port for web server (default: 5000)
- Make sure your
requirements.txtis up to date - The bot uses SQLite by default. For production, consider switching to PostgreSQL
- Set up proper logging in production
- Configure auto-deploy if desired
- Monitor your service after deployment
# Start bot locally
python bot.py
# Update requirements
pip freeze > requirements.txt
# Check logs on Render
# Use Render dashboard-
If bot doesn't start:
- Check logs in Render dashboard
- Verify environment variables
- Ensure all dependencies are in requirements.txt
-
If website endpoints don't work:
- Check if PORT environment variable is set
- Verify Flask server is running
- Check Render logs for errors
-
Database issues:
- Ensure write permissions in data directory
- Check disk space on Render
- Consider backing up data regularly