🚀 v2.0.0 — Now with Thin Core

Titan Framework

A plugin-based, event-driven Discord bot framework for Python with thin-core architecture and zero restrictions.

🐍 Python 3.11+ 📦 Plugin-Based ⚡ Event-Driven 🧩 Thin Core 📄 JSON Config
1500
Core Lines
2
Built-in Modules
100%
Open Source

✨ Features

🔌

Plugin-Based

Every feature is a plugin. Add or remove modules without touching the core. Just drop a folder with register.json.

Priority Loading

Control load order with priority in register.json. Lower number = loads first.

🎯

Event-Driven

Built-in EventBus for loose coupling between modules. Modules don't know each other.

🧩

Service Container

Dependency Injection container for sharing services. services.get() anywhere.

🧠

Thin Core

~1500 lines of core code. Everything else is a plugin. Minimal and stable.

📄

JSON Config

Configure via config/framework.json and config/exports.json.

🔄

Hot Reload

Reload modules at runtime without restarting the bot. Perfect for development.

🛡️

Built-in AntiSpam

Production-ready spam detection with warning levels, decay timers, mute role.

🚀

Zero Restrictions

Modules can do ANYTHING. No hand-holding, no artificial limits.

🧠 Architecture

┌─────────────────────────────────────────────────────────────┐
│                      Titan Framework                        │
└─────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────┐
│               Core (Thin Core - ~1500 lines)                │
│                                                             │
│   • EventBus      - Loose coupling                         │
│   • ServiceContainer - Dependency Injection                │
│   • PriorityRegistry - Module discovery & loading          │
│   • Hub           - Central coordinator                    │
│                                                             │
│   from core import *  ← Single entry point                 │
└─────────────────────────────────────────────────────────────┘
                              │
        ┌─────────────────────┼─────────────────────┐
        ▼                     ▼                     ▼
┌───────────────┐   ┌───────────────┐   ┌───────────────┐
│   config/     │   │   modules/    │   │   plugins/    │
│  (JSON Config)│   │  (Plugins)    │   │  (Extensions) │
└───────────────┘   └───────────────┘   └───────────────┘

🚀 Installation

# Clone the repository
git clone https://github.com/Ratin568/titan-framework.git
cd titan-framework

# Install dependencies
pip install -r requirements.txt

# Configure environment
cp .env.example .env

# Edit .env with your Discord bot token

# Run the bot
python main.py

📁 Project Structure

titan-framework/
├── core/                    # Thin Core
│   ├── events/              # EventBus
│   ├── container/           # ServiceContainer
│   └── registry/            # PriorityRegistry
├── config/                  # JSON Configuration
│   ├── framework.json
│   └── exports.json
├── modules/                 # Plugins
│   ├── antispam/
│   └── hello_world/
├── main.py
└── README.md

📦 Built-in Modules

ModulePriorityTypeDescription
antispam 10 Complex Spam detection with warning levels, decay timers, mute role
hello_world 100 Simple Minimal example with /hello command

🛠 Creating a Module

# Step 1: Create folder
modules/my_module/
├── register.json
└── main.py

# Step 2: register.json
{
  "name": "my_module",
  "priority": 50,
  "enabled": true,
  "files": ["main.py"]
}

# Step 3: main.py
from core import *

async def setup_module(bot, event_bus, services):
    @bot.tree.command(name="hello")
    async def hello(interaction):
        await interaction.response.send_message("Hello!")

⚙️ Configuration

📄 framework.json

{
  "bot": {
    "prefix": "!",
    "guild_id": 1122769174045917265,
    "activity": {
      "name": "Titan System",
      "type": "watching"
    }
  },
  "modules": {
    "search_paths": ["modules", "plugins"]
  }
}

📄 exports.json

{
  "core": [
    "TitanHub",
    "EventBus",
    "ServiceContainer"
  ],
  "modules": {
    "antispam": [
      "is_spamming",
      "get_user_info"
    ]
  },
  "custom": []
}

🧯 Troubleshooting

ProblemSolution
Module not loadingCheck register.json exists and enabled is true
Slash commands not showingWait 1-2 minutes. Check guild_id in config
Import errorsUse from core import * instead of direct imports
Service not foundRegister service with services.register() first