Skip to content

AyushSharma297/Discord_Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Rajjo Gujjar Bot Logo

Rajjo Gujjar πŸ’• Discord Bot


Python Files Folders Lines of Code Last Updated

Overview

Rajjo Gujjar πŸ’• is a feature-rich, modular Discord bot designed for fun, engagement, and server management. Built with Python and leveraging LLM-powered conversational AI, it offers playful chat, music playback, moderation, giveaways, logging, and more. The bot is organized using Discord.py cogs for maintainability and scalability.


Features

  • Conversational AI: Chat with Rajjo Gujjar using context-aware LLM responses.
  • Music Playback: Play, queue, skip, and manage music with Lavalink integration.
  • Moderation Tools: Purge messages, log edits/deletes, set/unset log channels, and run giveaways.
  • Fun & Games: Russian Roulette, memes, and interactive features.
  • Utilities: User info, server info, markdown posting, latency checks.
  • Logging: All interactions are logged to a SQLite database for analytics and history.
  • Voice TTS: Make the bot speak in voice channels using Google TTS.
  • Cog-Based Architecture: Easy to extend and maintain.

Technologies Used

  • Python 3.10+
  • discord.py – Discord API wrapper
  • aiohttp – Async HTTP client
  • FastAPI – LLM API backend
  • LightRAG - Hybrid Graph RAG
  • pandas – Data manipulation and logging
  • dotenv – Environment variable management
  • Lavalink – Music playback
  • Google TTS – Text-to-speech
  • Logging – Built-in Python logging

Directory Structure

Discord Bot/
β”‚
β”œβ”€β”€ main.py                # Main bot file (startup, cog loading, Lavalink setup)
β”œβ”€β”€ methods.py             # Utility functions (conversation history, LLM calls)
β”œβ”€β”€ requirements.txt       # Python dependencies
β”œβ”€β”€ .env                   # Environment variables (BOT_TOKEN, API_URL, etc.)
β”œβ”€β”€ data/                  # Database and data files
β”‚   └── chat_log.db        # SQLite database (auto-created)
β”œβ”€β”€ cogs/                  # Cog modules directory
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ music.py           # Music commands
β”‚   β”œβ”€β”€ moderation.py      # Moderation commands
β”‚   β”œβ”€β”€ utility.py         # Utility commands
β”‚   β”œβ”€β”€ ai_chat.py         # AI chat and TTS commands
β”‚   β”œβ”€β”€ fun.py             # Fun commands and games
β”‚   β”œβ”€β”€ events.py          # Event handlers
β”‚   └── roast.py           # Roasting commands
β”œβ”€β”€ LLM_server/
β”‚   β”œβ”€β”€ ollama_call.py     # FastAPI backend for LLM inference via Ollama
β”‚   β”œβ”€β”€ rag_call.py        # Calling Tool for LightRAG API  
β”‚   └── web_search.py      # Calling Tool for Web_Search API
└── README.md              # Project documentation

Setup & Installation

1. Clone the Repository

git clone https://github.com/AyushSharma297/Discord_Bot.git
cd discord-bot

2. Install Dependencies

pip install -r requirements.txt

or

recommended πŸ€–

poetry install 

3. Configure Environment Variables

Create a .env file in the project root:

BOT_TOKEN=your_discord_bot_token
API_URL=http://localhost:8000/ollama_query/

### More in env.example

4. Start the FastAPI Backend , LightRAG and Lavalink servers.

FastAPI Backend :

uvicorn LLM_server.ollama_call:app --host 0.0.0.0 --port 8000 --reload

LightRAG :

lightrag-server

Lavalink :

java -jar Lavalink.jar

5. Run the Discord Bot

python main.py

Usage

  • Use !help in your Discord server to see all available commands.
  • Chat with Rajjo using !chat <your message>.
  • Moderate and manage your server with built-in utilities.
  • Play music, run giveaways, and enjoy fun games.

Example Commands

Command Description
!chat <message> Chat with Rajjo Gujjar πŸ’•
!play <song> Play a song or add it to the queue
!queue Show the current music queue
!skip Skip the current track
!purge <count> Delete a specified number of previous messages
!setlog <channel_name> Set the log channel by name
!unsetlog Unset the log channel for this server
!giveaway <time_in_seconds> <prize> Start a giveaway
!userinfo [member] Show information about a user
!serverinfo Show detailed information about the server
!markdown <channel> [embed=True] <text> Send a markdown message to a specified channel
!roulette [mode] [ante] Play Russian Roulette game
!meme [sort_type] [time_filter] Get a random meme from Reddit

Use the !help command in your Discord server to discover all available commands and their usage instructions.

Pro Tip: The help command will show you the exact syntax, required parameters, and optional arguments for each command, making it easy to use them correctly.


πŸ“Έ Screen-Shots

πŸ’¬ Chat Command Examples

chat_example1 chat_example2 chat_example3

πŸ–ΌοΈ Image Chat Command Examples

Image_example

πŸŽ‰ Fun Command Examples

Fun_example Fun_example2

βž• Additional Command Examples

Additonal_example Additonal_example2 Additonal_example Additonal_example2

πŸ€– LightRAG UI Examples

Additonal_example Additonal_example2
Additonal_example Additonal_example2

Contributing

Contributions are welcome! Please open an issue or submit a pull request for improvements or new features. All contributions must follow the Microsoft Open Source Code of Conduct.


Support & Feedback

For questions, suggestions, or issues, please reach out via GitHub Issues or contact the maintainer.


Rajjo Gujjar πŸ’• β€” Stealing Hearts, One Message at a Time!

About

An advanced Discord bot powered by a Large Language Model (LLM),GraphRAG , AI Agents and providing intelligent AI chat, music playback, interactive games, and server management tools. Easily customizable and designed for seamless integration in any Discord server.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages