A modern Discord bot powered by Google Gemini AI (1.5 Pro, 1.5 Flash, Bard) that supports slash commands, system instructions, cookies, and more. Built with Python 3.10+, this project supports both API Key and cookie-based authentication for Gemini and Bard, and runs seamlessly with Docker and Replit support.
Note: This bot includes multi-user session support, persistent thread conversations, and customizable safety settings.
- Python 3.10 or higher
- Discord bot token
- Gemini API key or Bard cookies
git clone https://github.com/phoenixfusionx/discord-aichatbot.git
cd discord-aichatbot
pip install -r requirements.txt
Rename .env.dev
to .env
, then update it with your tokens and cookies:
DISCORD_BOT_TOKEN=your_discord_token
GEMINI_API_KEY=your_gemini_api_key
BARD_SECURE_1PSID=your_bard_cookie
BARD_SECURE_1PSIDTS=your_bard_cookie_ts
GEMINI_SETTING_CHANNEL_ID=
GEMINI_CHAT_CHANNEL_ID=
BARD_COOKIES_SETTING_CHANNEL_ID=
BARD_CHAT_CHANNEL_ID=
HELP_CMD_CHANNEL_ID=
python3 bot.py
- Slash command:
/gemini conversation
- Supports Gemini 1.5 Pro, Flash, and 1.0 Pro
- Supports system instructions and temperature control
- Safety settings: harassment, hate, sexual, danger filters
- Slash command:
/bard conversation
- Requires Bard cookies:
__Secure-1PSID
,__Secure-1PSIDTS
/api_key setting-gemini [set|delete] [key]
/cookies setting-bard [set|delete] [cookie values]
- Creates private/public Discord threads for user interactions
- Session-specific threads for clean UX
To run with Docker:
docker-compose up --build -d
This will:
- Start the bot
- Mount
.env
- Manage dependencies in isolation
- Generative AI Python
- GiminiAI
This project is licensed under the AGPL-3.0 License.