Skip to content

A sophisticated Telegram Community Moderator Bot simulation designed to act as the "Ideal Intern" for the Mudrex community. This project provides a Logic Studio to visualize, configure, and test the bot's autonomous decision-making engine.

License

Notifications You must be signed in to change notification settings

DecentralizedJM/mudrex-telegram-intern

Repository files navigation

Mudrex Telegram Intern Bot πŸ€–

Proprietary AI-Powered Community Manager for Telegram
Created by @DecentralizedJM

An intelligent Telegram bot powered by Google Gemini 3 Pro Preview that manages community conversations, detects scams, provides emotional support, and answers questions about Mudrex with a polite, helpful, and positive personality.


🎯 Bot Personality & Characteristics

Core Traits:

  • 😊 Polite & Positive - Always supportive and encouraging
  • 🀝 Professional but Friendly - Builds trust with the community
  • πŸ’š Empathetic - Provides emotional support during market volatility
  • πŸ›‘οΈ Protective - Actively detects and warns against scams
  • πŸ‡¬πŸ‡§ English-First - Uses Hindi/Hinglish only when users speak Hindi

Communication Style:

  • Uses varied vocabulary (never repeats generic phrases)
  • Responds with warmth and professionalism
  • De-escalates angry users with empathy
  • Handles trolls by staying kind and professional
  • Provides crisis support for distressed users

✨ Key Features

🧠 AI-Powered Intelligence (Gemini 3 Pro Preview)

  • Model: gemini-3-pro-preview - Google's latest and most advanced AI
  • Temperature: 0.8 (creative and varied responses)
  • Structured JSON Output - Reliable decision-making
  • Context-Aware - Analyzes last 15 messages for conversation flow

πŸ›‘οΈ 3-Tier Anti-Scam System

  1. Pre-AI Filtering - Blocks spam before API call (90% efficiency)

    • Ignores: "lol", "ok", emoji-only, 1-3 char messages
    • Detects: Critical keywords (P2P, USDT selling, VIP signals)
  2. Critical Keyword Detection

    • P2P deals, investment scams, phishing attempts
    • Automatic response with admin tagging
  3. AI Decision Engine

    • Context-aware threat assessment
    • Polite warnings instead of mocking
    • Tags: @DecentralizedJM and @babaearn23

⚑ Rate Limiting & Efficiency

  • Daily Limit: 50 responses/day
  • Auto-Reset: Midnight (prevents spam)
  • Smart Filtering: Only critical/direct messages reach AI
  • Cost Optimization: 90% of messages filtered pre-AI

πŸ’¬ Conversation Management

1. Scam Detection (Highest Priority)

  • Detects: P2P solicitation, fake investments, phishing
  • Response: "Hey there! This looks like a P2P solicitation which isn't allowed here. @DecentralizedJM @babaearn23 - please review this message."

2. Troll Handling

  • Light teasing β†’ Warm, humorous response
  • Persistent baiting β†’ Silent ignore
  • Strategy: Kill them with kindness

3. Angry User De-escalation

  • Detects: CAPS LOCK, "SCAM", frustration
  • Response: "I understand you're frustrated. Let's get this sorted out! Please email help@mudrex.com and the team will assist you right away."

4. Crisis Support

  • Detects: Suicidal ideation, extreme distress
  • Response: Empathetic support + resource connection
  • Example: "Please know that your life is worth far more than any crypto portfolio. You are not alone. @DecentralizedJM @babaearn23"

5. Casual Engagement

  • Greetings: "Good morning! β˜€οΈ How can I help you today?"
  • Checks history to avoid being clingy
  • Friendly but not intrusive

6. Company Q&A

  • Answers Mudrex-related questions
  • Directs to help@mudrex.com when needed
  • Uses knowledge base for accurate information

πŸš€ Quick Start

Prerequisites

Installation

# Clone the repository
git clone https://github.com/DecentralizedJM/mudrex-telegram-intern.git
cd mudrex-telegram-intern

# Install dependencies
npm install

# Create .env file
echo "TELEGRAM_BOT_TOKEN=your_bot_token_here" > .env
echo "GEMINI_API_KEY=your_gemini_key_here" >> .env

# Build TypeScript
npm run build

# Start the bot
npm run bot

Configuration

Create a .env file in the root directory:

TELEGRAM_BOT_TOKEN=7962595360:AAEa...your_token
GEMINI_API_KEY=AIzaSyA...your_key

πŸ“‹ Commands

Command Description
/help Show bot capabilities and rules
/stats Display daily usage (responses/limit/remaining)

πŸ—οΈ Architecture

Backend-Only Design (v2.0)

  • βœ… Removed: All React/Vite UI components
  • βœ… Terminal Execution: Runs via npm run bot
  • βœ… TypeScript: Type-safe, production-ready code
  • βœ… Environment-Based: Credentials via .env file

File Structure

mudrex-telegram-intern/
β”œβ”€β”€ bot/
β”‚   └── index.ts              # Bot entry point + commands
β”œβ”€β”€ services/
β”‚   └── geminiService.ts      # AI logic (PROPRIETARY - DO NOT MODIFY)
β”œβ”€β”€ types.ts                  # TypeScript interfaces
β”œβ”€β”€ package.json              # Dependencies (UNLICENSED)
β”œβ”€β”€ tsconfig.json             # TypeScript config (backend-only)
β”œβ”€β”€ .env.example              # Environment template
β”œβ”€β”€ LICENSE                   # Proprietary license
β”œβ”€β”€ README.md                 # This file
└── CHANGELOG.md              # Version history

πŸ§ͺ Testing

Test Scenarios

Spam Filter:

βœ… Send "lol" β†’ Ignored (spam)
βœ… Send "GM" β†’ Polite greeting (once)
βœ… Send "" (empty) β†’ Ignored

Scam Detection:

βœ… "Sell USDT cheap" β†’ Warns + tags admins
βœ… "P2P deal available" β†’ Warns + tags admins
βœ… "Join my VIP signal group" β†’ Warns + tags admins

Direct Engagement:

βœ… "@MudrexIntern_bot how do I deposit?" β†’ Helpful answer
βœ… "How to withdraw from Mudrex?" β†’ Guides to resources

Emotional Support:

βœ… "I lost all my money" β†’ Empathetic response
βœ… Angry user β†’ De-escalates professionally
βœ… Suicidal ideation β†’ Crisis support + admin tag

πŸ”§ Technical Specifications

AI Model: Gemini 3 Pro Preview

{
  model: 'gemini-3-pro-preview',
  temperature: 0.8,              // Creative, varied responses
  responseMimeType: 'application/json',
  responseSchema: {
    shouldReply: boolean,        // Decision to respond
    reasoning: string,           // Why bot decided
    response: string | null      // Reply text
  }
}

Rate Limiting

const DAILY_RESPONSE_LIMIT = 50;
// Auto-resets at midnight
// Tracks: responsesToday, limit, remaining

Spam Detection Patterns

// Ultra-strict filtering
const spamPatterns = [
  /^(lol|lmao|haha|ok|k|yes|no|nice|cool|wow|gm|gn|hi|hello)$/i,
  /^[\u{1F600}-\u{1F64F}...]+$/u,  // Emoji-only
  /^.{1,3}$/,                       // Too short
  /^[\s.!?]+$/                      // Only punctuation
];

Critical Keywords (Scam Detection)

const criticalPatterns = [
  /\b(sell\s+usdt|buy\s+usdt|p2p\s+deal|dm\s+me|vip\s+signal)\b/i,
  /\b(investment\s+opportunity|guaranteed\s+profit|free\s+usdt)\b/i
];

οΏ½οΏ½ Performance Metrics

  • Pre-Filter Efficiency: ~90% of messages blocked before AI call
  • Response Time: ~2-3 seconds (Gemini API call)
  • Filter Speed: <1ms (regex-based)
  • Memory Usage: ~50MB (Node.js baseline)
  • API Cost Savings: 90% reduction via smart filtering

πŸ” Security & Privacy

  • API Keys: Stored in .env (never committed to git)
  • No Data Storage: Chat history kept in-memory only (last 20 messages)
  • Rate Limiting: Prevents abuse (50 responses/day)
  • Proprietary License: Code modifications prohibited without permission

πŸ“š Documentation

  • CHANGELOG.md - Version history and feature timeline
  • UPGRADE_SUMMARY.md - Detailed upgrade guide (v1.0 β†’ v2.0)
  • LICENSE - Proprietary license terms
  • .env.example - Environment variable template

πŸ› οΈ Development

Build Commands

npm run build    # Compile TypeScript
npm run start    # Run production build
npm run dev      # Build + Run
npm run bot      # Alias for dev

Adding New Features

  1. Modify services/geminiService.ts for AI logic
  2. Update bot/index.ts for commands/handlers
  3. Test locally with npm run bot
  4. Build with npm run build

πŸ“ Version History

v2.0.0 (November 2025)

  • βœ… Upgraded to Gemini 3 Pro Preview
  • βœ… Removed React/Vite frontend (backend-only)
  • βœ… Changed personality: Polite, Helpful, Positive
  • βœ… Implemented 50/day rate limiting
  • βœ… Enhanced 3-tier spam filtering
  • βœ… Added crisis support for suicidal ideation
  • βœ… Professional de-escalation for angry users
  • βœ… English-first communication
  • βœ… Proprietary license and copyright protection

v1.0.0 (Initial)

  • Basic Telegram bot with Gemini 2 Flash
  • React UI for simulation
  • Sarcastic personality

🀝 Contributing

This is proprietary software. Modifications are not permitted without explicit written permission from @DecentralizedJM.

For licensing inquiries: https://github.com/DecentralizedJM


πŸ“„ License

Copyright Β© 2025 DecentralizedJM. All Rights Reserved.

This software is proprietary and confidential. Unauthorized copying, modification, distribution, or reverse-engineering is strictly prohibited. See LICENSE file for details.


πŸ“§ Contact & Support

  • Creator: @DecentralizedJM
  • Telegram: @DecentralizedJM
  • Issues: Open an issue on GitHub (feature requests only)
  • Licensing: Contact via GitHub

πŸ™ Acknowledgments

  • Google Gemini AI - Advanced language model
  • Telegram Bot API - Messaging platform
  • Mudrex - Crypto trading platform

Built with ❀️ by @DecentralizedJM

Note: This bot is designed for community management. Always comply with Telegram's Terms of Service and local regulations.

About

A sophisticated Telegram Community Moderator Bot simulation designed to act as the "Ideal Intern" for the Mudrex community. This project provides a Logic Studio to visualize, configure, and test the bot's autonomous decision-making engine.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published