A Discord bot leveraging Google Gemini for advanced conversation, content understanding, image/video/audio recognition, and more.
- Conversational AI powered by Google Gemini (Gemini-2.5-Flash)
- Image/video/audio and file recognition (supports images, videos, audios, PDFs, docx, pptx, and code/text files)
- Custom personalities per user, channel, or server
- Server and channel-wide chat history options
- Admin controls for blacklisting/whitelisting users
- Downloadable conversation/message history
- Multiple AI tools: Google Search, code execution, and function calling
- Status monitoring (RAM, CPU, and reset timer)
- Slash command and button-based UI
- Node.js v20+ recommended
- Discord bot token (create here)
- Google Gemini API key (get one here)
-
Clone the repo:
git clone https://github.com/hihumanzone/Gemini-Discord-Bot.git cd Gemini-Discord-Bot -
Install dependencies:
npm install
-
Configure environment variables:
- Copy
example.envto.env - Fill in your Discord and Google API tokens:
DISCORD_BOT_TOKEN=your_discord_bot_token GOOGLE_API_KEY=your_google_api_key
- Copy
-
Start the bot:
npm start
- Invite the bot to your Discord server.
- Use
/settingsto configure personal or channel preferences. - Use
/server_settingsfor server-wide admin controls. - Upload supported files or image/video/audio files and ask the bot about them.
- Use slash commands:
/respond_to_all enabled:true|false– Bot responds to every message in a channel/clear_memory– Clear your personal conversation history/toggle_channel_chat_history enabled:true|false [instructions]– Channel-wide conversation/blacklist user:@user– Prevent a user from using the bot/whitelist user:@user– Remove a user from the blacklist/status– Show system status
- Modify
config.jsto change default personalities, activities, colors, and feature toggles. - Persistent data (chat history, settings, blacklists, etc.) is stored in the
configdirectory.
- Only server admins can use admin commands (blacklist, whitelist, server settings).
- Blacklisted users cannot interact with the bot.
- The bot stores chat history and settings locally. For production use, consider using persistent cloud storage.
- Do not commit your
.envwith secrets.