A Discord bot powered by Google's Gemini AI that can chat naturally with users.
- 🤖 Powered by Google Gemini AI
- 💬 Natural conversation responses
- 📝 Optional channel restrictions
- 🎯 Easy to configure and deploy
npm installCreate a .env file in the root directory with the following content:
# Discord Bot Configuration
DISCORD_TOKEN=YOUR_DISCORD_BOT_TOKEN_HERE
# Gemini AI Configuration
GEMINI_API_KEY=YOUR_GEMINI_API_KEY_HERE
# Optional: Channel ID to restrict bot to specific channel
# Leave empty to respond in all channels
# CHANNEL_ID=1234567890123456789Important: Replace YOUR_DISCORD_BOT_TOKEN_HERE with your actual Discord bot token.
- Go to Discord Developer Portal
- Create a new application or select an existing one
- Go to the "Bot" section
- Click "Reset Token" or "Copy" to get your bot token
- Enable "Message Content Intent" under Privileged Gateway Intents
- Go to "OAuth2" > "URL Generator"
- Select scopes:
bot,applications.commands - Select bot permissions:
Send Messages,Read Message History - Copy the generated URL and open it in your browser to invite the bot to your server
npm startOr:
node index.jsOnce the bot is running, simply type messages in your Discord server. The bot will respond using Gemini AI.
If you set a CHANNEL_ID in your .env file, the bot will only respond in that specific channel. If you don't set it, the bot will respond to all channels where it has permission.
- Check that the Discord token is correct in your
.envfile - Make sure Message Content Intent is enabled in Discord Developer Portal
- Verify the bot has permission to read and send messages in the channel
- Check console logs for error messages
- Verify your Gemini API key is valid
- Check your internet connection
- Look at the console for detailed error messages
ISC