Skip to content

Garvit711/Discord_BOT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Garvit Bot — Conversational AI & Study Tracker

A context-aware, highly interactive Discord bot powered by Google Gemini APIs and backed by MongoDB Atlas. It bridges the gap between structured utilities and natural human conversation, allowing users to execute tasks via slash commands or simply by chatting naturally in the server.


📸 Interface Preview

Screenshot 2026-06-08 155217

🚀 Key Features & Multi-Mode Interaction

The bot natively handles two styles of interaction depending on how your server members prefer to work.

1. Seamless Conversational Mode ("Garvit" Mentions) ✨

  • The Ultimate Perk: Users don't need to remember rigid command syntaxes. Mentioning "Garvit" or explicitly tagging the bot triggers the conversational engine.
  • Deep Context Comprehension: The bot dynamically processes the last 10 messages in the channel before responding. It understands ongoing conversations, remembers context, and follows up naturally using Gemini 3.1 Flash Lite.
  • Intelligent Intent Routing: Instead of relying on fragile regex or keyword matching, Gemini acts as a dynamic routing layer. It analyzes natural language and converts user intent into backend operational triggers such as:
[START_STUDY]
[START_BREAK]
[END_STUDY]

allowing the study tracker to operate seamlessly through free-form conversation.


2. Structured Interaction Mode (Slash Commands /)

  • Powered by Gemini 2.5 Flash for fast and efficient execution.
  • Managed through Discord's interactionCreate event.
  • Provides a reliable command-based workflow for users who prefer direct utility commands.

📝 Automated Study Tracker Module

A persistent productivity tracker powered by MongoDB Atlas and tightly integrated with the conversational engine.

Features

  • Frictionless Sessions

    • Start, track, and complete study sessions through natural chat messages.
    • Backend session validation prevents overlapping study sessions.
  • Smart Dynamic Breaks

    • Request timed breaks naturally:

      "Garvit, create a break for me and notify me in 3 minutes."

    • The bot schedules an asynchronous reminder and pings the user exactly when the break ends.

  • Witty & Gamified Feedback

    • Custom contextual responses keep users engaged.
    • Includes playful roast messages when users attempt actions that don't make sense.

Example:

"You never started a study session. Stop imagining the victory edit 💀🔥"


🛠️ Tech Stack

Badges

Node.js Discord.js Google Gemini MongoDB Express.js

Stack Overview

Component Technology
Runtime Node.js
AI Integration Google Gemini API (Gemini 3.1 Flash Lite & Gemini 2.5 Flash)
Database MongoDB Atlas (Mongoose ODM)
Web Framework Express.js
Discord Library Discord.js v14

📂 Project Architecture

├── CommandBuilder/
│   └── commandBuild.js          # Dynamic slash command registration

├── Controllers/
│   ├── normalChat.js            # Context scraper & conversational router
│   ├── handlers.js              # Study Tracker business logic
│   └── commandTalk.js           # Slash command execution pipeline

├── Gemini_API/                  # Gemini API initialization & wrappers

├── Models/                      # MongoDB schemas & DB connection layer

├── index.js                     # Express server + Discord event gateway

└── package.json                 # Project manifest

⚙️ Setup & Local Installation

Prerequisites

  • Node.js (v18 or higher)
  • MongoDB Atlas cluster
  • Discord Bot Token
  • Google Gemini API Key

1. Clone the Repository

git clone https://github.com/Garvit711/Discord_BOT.git
cd Discord_BOT

2. Install Dependencies

npm install

2.1 install the core packages:

npm install discord.js express mongoose

3. Configure Environment Variables

Create a .env file in the project root:

TOKEN=your_discord_bot_token
API_KEY=your_gemini_api_key
MONGODB_URI=your_mongodb_atlas_connection_string
GUILD_ID=your_development_server_id
PORT=3000

4. Start the Bot

node index.js

If everything is configured correctly, the bot will connect to Discord, establish a MongoDB connection, and begin handling both conversational and slash-command interactions.


About

A context-aware Discord bot bridging natural chat and structured utilities. Features an automated study tracker, dynamic break reminders, and dual-mode interaction powered by Google Gemini APIs (3.1 Flash Lite / 2.5 Flash), discord.js v14, and MongoDB Atlas.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors