Gemini ChatBot is a powerful Discord bot powered by the Gemini 2.5 API. It enables natural language interaction through direct messages, mentions, and slash commands. Designed for performance and easy customization, this bot provides intelligent responses, helps with basic queries, and includes utility slash commands for specific tasks.
- π¬ Natural Language Chat: Responds to users via DM or mention using Google's Gemini API.
- π§ Context-Aware: Replies with a tone depending on the detected mood (neutral or humorous).
- π History Context: The bot is capable of reading the chain of linked messages while maintaining the entire context of the conversation.
- π» Slash Commands: Offers various commands like
/help,/ping,/code, and/imaginefor guidance, performance checks, code generation, and image creation. - βοΈ Configurable Behavior: Uses system instructions to shape replies and stay within Discord's message limits.
- π¬ Multimodal: You can interact with several types of data, not only text.
Here are some examples of the bot in action:
discord-gemini-chatbot/
β
βββ src/
β βββ commands/ # Slash commands like /help, /ping, /code, /imagine
β βββ events/ # Discord event handlers (e.g. messageCreate, interactionCreate)
β βββ lib/ # Shared utilities, types, and internal logic reused across the bot
β βββ index.ts # Bot entry point
β
βββ .env # Environment variables (tokens and API keys)
βββ README.md # Project documentation
- Node.js v18+
- Discord bot token
- Google Gemini API key (from Google AI Studio)
Create a .env file based on .env.example:
cp .env.example .envThen edit the .env file with your actual values:
DISCORD_TOKEN=your-discord-token
CLIENT_ID=your-bot-id
GEMINI_API_KEY=your-gemini-api-key- Go to the Discord Developer Portal
- Create a new application
- Go to the "Bot" section and create a bot
- Copy the bot token (this is your
DISCORD_TOKEN) - Go to "General Information" and copy the Application ID (this is your
CLIENT_ID) - Invite the bot to your server with appropriate permissions
- Visit Google AI Studio
- Create a new API key
- Copy the API key (this is your
GEMINI_API_KEY)
npm install
npm run build
npm run startMake sure your bot is invited with appropriate Intents and Slash command scope.
There is a config.json file in the root directory, edit this file for specific behaviors, custom modifications or API usage. It provides easy access to bot functionality.
| Command | Description |
|---|---|
/help |
Shows basic usage information |
/ping |
Displays response and API latency |
/code |
Generate code based on your prompt |
/imagine |
Generate an image based on your prompt |
- Mention the bot (
@Gemini) or send it a DM to start chatting. - Responses are limited to ~2000 characters per message, if the bot reach the limit, it will split the response in multiple messages.
- Use slash commands for specific functionalities.
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Run tests:
npm run lintandnpm run build - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
If you discover a security vulnerability, please see our Security Policy for reporting guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
- π Documentation
- π Issue Tracker
- π¬ Discussions
_Created with π» by NamlessChokko


