Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Leverage Gemini AI on Discord with advanced customization and seamless thread-based personal conversations.

License

Notifications You must be signed in to change notification settings

phoenixfusionx/discord-aichatbot

Repository files navigation

DiscordBot - GeminiAI

GeminiAI Bot Demo

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.

Getting Started

Prerequisites

  • Python 3.10 or higher
  • Discord bot token
  • Gemini API key or Bard cookies

1. Clone the Repository

git clone https://github.com/phoenixfusionx/discord-aichatbot.git
cd discord-aichatbot

2. Install Dependencies

pip install -r requirements.txt

3. Configure Environment Variables

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=

4. Start the Bot

python3 bot.py

Features

✅ Gemini Integration

  • 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

✅ Bard Integration

  • Slash command: /bard conversation
  • Requires Bard cookies: __Secure-1PSID, __Secure-1PSIDTS

✅ API Key and Cookie Management

  • /api_key setting-gemini [set|delete] [key]
  • /cookies setting-bard [set|delete] [cookie values]

✅ Threaded Conversations

  • Creates private/public Discord threads for user interactions
  • Session-specific threads for clean UX

Docker Support

To run with Docker:

docker-compose up --build -d

This will:

  • Start the bot
  • Mount .env
  • Manage dependencies in isolation

Acknowledgements

  • Generative AI Python
  • GiminiAI

License

This project is licensed under the AGPL-3.0 License.

About

Leverage Gemini AI on Discord with advanced customization and seamless thread-based personal conversations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published