Skip to content

SrivarsanK/discordbot

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

138 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DSC SRM RMP Discord Bot


forthebadge forthebadge
Discord Support Dashboard Website NodeJS Version Database Neon License

DSC SRM RMP Discord Bot is a premium, feature-rich, all-in-one Discord bot featuring active anti-nuke server security, robust auto-moderation, a modern leveling system, custom profiles, and automated log verification.

All features are configurable through a highly responsive glassmorphic web dashboard hosted at https://bot.developerstudents.club, powered by Drizzle ORM and Neon Serverless Postgres.


πŸ–ΌοΈ App Screenshots

Server Selection Page Interactive Configuration Dashboard
Server Selection Page Interactive Configuration Dashboard

Landing Page Interface

Landing Page Interface

🧠 Double-Gated LeetCode Verification System

A highly unique, automated coding challenge tracker featuring dual-gate validation to credit daily solves.

1. Account Binding (/register & /verify)

  • Token Generation: Run /register <username>. The bot generates a temporary token (DSCRD-XXXXXX).
  • Verification: Paste this token into your LeetCode Profile README (About Me) section and run /verify. The bot queries the LeetCode profile, extracts the token, and links the accounts.

2. Solve Submission & OCR Validation (/submit)

  • Gate 1 (Image OCR Reader): Upload a screenshot of your accepted challenge solution. The bot uses Tesseract.js to read text from the image, looking for a unique challenge round code (nonce, e.g. LC-XXXXXX) embedded in the screenshot.
  • Gate 2 (LeetCode API Check): The bot queries LeetCode's submission records for the bound user to ensure the target problem was successfully solved and accepted within 24 hours of posting.
  • Difficulty-Based Points: Awards points based on difficulty (default points: Easy: 10, Medium: 20, Hard: 30).
  • Dynamic Shoutouts: Celebrates solved questions by posting the user's solution screenshot in the designated shoutout channel.
  • Leaderboards: Provides overall, weekly, and monthly points rankings using /leaderboard or !leaderboard.

✨ Features & Bot Capabilities

πŸ›‘οΈ Security & Anti-Nuke Guard

  • Mass Action Prevention: Automatically detects and blocks mass bans, kicks, role deletes, and channel deletes.
  • Asset Protection: Anti-everyone/here mention protection, webhook alteration guards, and emoji/sticker change security.
  • Access Control: Custom Whitelist system allowing trusted users to bypass security measures.
  • Anti-Bot Add: Blocks unauthorized bots from joining and auto-kicks them.
  • Extra Owners: Assign extra owner roles to manage security settings using !extraowner.

βš™οΈ Automation & Engagement

  • Auto-Responder & React: Trigger custom text replies or emoji reactions based on keywords.
  • Auto-Role: Failsafe role assignment for humans and bots upon server join with API backup.
  • Voice Roles: Configure roles to assign or remove dynamically when users join or leave voice channels (!invcrole).
  • Welcome System: High-impact welcome banners generated dynamically on canvas.
  • VC Guard & Sticky Messages: Protect specific voice channels with bypass roles; keep critical announcements pinned at the bottom of active channels.
  • Leveling System: Track voice and text XP with level-up banner notifications.

πŸ“ Interactive Log Verification System

  • Forum & Thread Support: Direct logs to normal text channels, thread channels, or parent forum channels.
  • Channel Verification: Secure verification token system (!verify-log <token>) to hook target log channels.
  • Custom Filters: Event ignore lists for specific channels, roles, or users, with ignore options for embeds.
  • Event Categories: Message (Edits/Deletes), Channels, Roles, Members (Profile/Activity), Voice States, Thread states, Invites, and Moderation events.

πŸ”Š Advanced Voice Utilities

  • Bulk Voice Actions: Bulk deafen, mute, unmute, or undeafen members in your current channel.
  • Voice Management: Move all members in a channel to a target channel (!vcmoveall), or kick members from a voice session (!vckick, !vckickall).

πŸ‘€ Profile Customizer

  • Custom User Profiles: Customize bios, descriptions, and social media links via !bioset and display them via !bioshow.
  • Badge Systems: Award and display special custom badges on member profiles.

😊 Emoji Manager

  • Standalone Dashboard: Connects to your configured emoji manager panel.
  • Sync System: Synchronize your bot config application emojis directly to Discord application emojis.

πŸ› οΈ Developer Console

  • Dokdo Integration: safe code execution, eval commands, and live terminal testing for bot developers.

πŸ› οΈ Technology Stack

  • Engine: Discord.js v14 β€” Node.js library interacting with the Discord Gateway API.
  • Database: Neon Postgres β€” Serverless postgres database managed with Drizzle ORM.
  • Sharding: discord-hybrid-sharding β€” Process-based hybrid sharding for massive scale.
  • OCR Reader: Tesseract.js β€” Reads solution nonces from screenshot uploads.
  • Graphics Engine: Canvacard & Canvafy β€” Premium banner and rank card graphics generator.
  • Web App: Express.js β€” Serves the landing page and settings panel dashboard.

πŸ“‚ Repository Structure

β”œβ”€β”€ .env.example               # Environment variables template
β”œβ”€β”€ Shard.js                   # Bot cluster sharding manager
β”œβ”€β”€ index.js                   # Core bot client initialization
β”œβ”€β”€ migrate-leetcode.js        # Script to migrate LeetCode db schema
β”œβ”€β”€ migrate-server-stats.js    # Script to migrate Server Stats db schema
β”œβ”€β”€ update-and-start.sh        # Oracle Linux PM2 deployment script
β”œβ”€β”€ assets/                    # Dashboard and landing page screenshots
β”œβ”€β”€ docs/                      # Developer guides and system documentation
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ config.js              # Environment parser and static config
β”‚   β”œβ”€β”€ commands/              # Bot Prefix Commands
β”‚   β”‚   β”œβ”€β”€ Antinuke/          # Security rules, extra owners, & whitelists
β”‚   β”‚   β”œβ”€β”€ Automod/           # Anti-link and anti-spam configurations
β”‚   β”‚   β”œβ”€β”€ Config/            # Prefix, auto-responder, logging, stats configuration
β”‚   β”‚   β”œβ”€β”€ Fun/               # Fun and games commands (8ball, RPS, rate, coinflip)
β”‚   β”‚   β”œβ”€β”€ Image/             # Image manipulation (achievement, instagram, meeting, ship)
β”‚   β”‚   β”œβ”€β”€ LeetCode/          # Solve tracking, question posting, leaderboards
β”‚   β”‚   β”œβ”€β”€ Profile/           # User bios and customized socials
β”‚   β”‚   β”œβ”€β”€ Role/              # Auto-roles, custom roles, and voice roles
β”‚   β”‚   β”œβ”€β”€ Utility/           # Snipe, avatar button displays, server & user information
β”‚   β”‚   β”œβ”€β”€ Voice/             # Voice channel bulk management commands
β”‚   β”‚   └── Welcome/           # Custom canvas join-banner setup
β”‚   β”œβ”€β”€ slashCommands/         # Bot Slash Commands mapping prefix actions
β”‚   β”œβ”€β”€ events/                # Gateway client event handlers
β”‚   β”œβ”€β”€ db/                    # Drizzle connection and neon client setup
β”‚   β”œβ”€β”€ schema/                # Drizzle ORM Database Schema tables
β”‚   β”œβ”€β”€ loaders/               # Commands, buttons, and slash handlers loader
β”‚   β”œβ”€β”€ structures/            # Custom client extensions (MusicClient.js)
β”‚   └── dashboard/             # Express Web Application
β”‚       β”œβ”€β”€ public/            # Static files (HTML, CSS, JS)
β”‚       └── server.js          # OAuth2 login & API routes

πŸš€ Installation & Setup

Prerequisites

1. Clone the Repository

git clone https://github.com/dsc-srmrmp/newdiscordbot.git
cd newdiscordbot

2. Install Dependencies

npm install

3. Configure Environment

Create a .env file in the root directory (refer to .env.example for details):

# Bot Credentials
DISCORD_TOKEN=your_bot_token
DISCORD_CLIENT_ID=your_client_id
DISCORD_CLIENT_SECRET=your_client_secret
OWNER_ID=your_owner_id
PREFIX=>

# Database Connection
DATABASE_URL=postgresql://user:password@host/dbname?sslmode=require

# Dashboard setup
DASHBOARD_ENABLED=true
DASHBOARD_PORT=3000
DASHBOARD_PUBLIC_URL=https://bot.developerstudents.club

4. Push Database Schemas

Sync the Drizzle schemas with your PostgreSQL/Neon instance:

npx drizzle-kit push

5. Launch the Application

Run the sharded client in development mode or start it in production:

# Development (with nodemon auto-restart)
npm run dev

# Production
npm start

πŸ”„ Deployment & Automation

The bot features a deployment script (update-and-start.sh) designed for Oracle Linux/Ubuntu VPS environments under PM2:

  • Automatically fetches and pulls updates from main branch.
  • Installs dependencies and runs necessary migrations.
  • Starts/reloads the bot process using PM2.
chmod +x update-and-start.sh
./update-and-start.sh

πŸ“„ License

This project is licensed under the Apache-2.0 License.

About

A feature-rich Discord bot with an interactive web dashboard,custom LeetCode coding challenge tracking with OCR solve verification, advanced music playback (Lavalink), anti-nuke server security and automated logging.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages