Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
236 changes: 3 additions & 233 deletions docs/source/dev_guide/index.rst
Original file line number Diff line number Diff line change
@@ -1,234 +1,4 @@
===============================
👨‍💻 Developer Guide
===============================
Developer Guide
=======================

**Welcome to the ManagerX Developer Guide!**

This comprehensive documentation is your resource for understanding ManagerX's architecture, extending the bot, deploying it to production, and contributing to the project. Whether you're building a new feature, self-hosting ManagerX, or simply curious about how it works, you'll find everything you need here.

.. note::
**New to ManagerX?** Start with :doc:`getting_started/index` to set up your development environment.

.. important::
This project is under active development. Features and APIs may change. Check back regularly for updates!

---

🚀 Quick Start Paths
====================

**Want to get up and running immediately?**

1. Install dependencies → :doc:`installation/index`
2. Understand the structure → :doc:`project_structure/index`
3. Learn the architecture → :doc:`architecture/index`
4. Start coding → :doc:`bot_development/index`

**Deploying to production?**

1. Review deployment options → :doc:`deployment/index`
2. Set up your server → :doc:`deployment/index`
3. Configure monitoring → :doc:`deployment/index`
4. Establish backups → :doc:`database/index`

**Want to contribute?**

1. Fork the repository
2. Read :doc:`contributing/index`
3. Create a feature branch
4. Follow code style → :doc:`contributing/index`
5. Write tests → :doc:`testing/index`
6. Submit a pull request!

---

📚 Documentation Structure
===========================

**Getting Started**

- :doc:`getting_started/index` — Installation, setup, first steps
- :doc:`installation/index` — Detailed installation instructions
- :doc:`project_structure/index` — Repository organization

**Understanding ManagerX**

- :doc:`architecture/index` — System design and components
- :doc:`database/index` — SQLite database schema and operations
- :doc:`bot_development/index` — Building bot features and cogs
- :doc:`api_development/index` — Creating API endpoints

**Development**

- :doc:`testing/index` — Unit tests, integration tests, testing strategy
- :doc:`deployment/index` — Production deployment, hosting options
- :doc:`contributing/index` — Contribution guidelines, PR process
- :doc:`troubleshooting/index` — Debugging and common issues

---

🏗️ Architecture Overview
=========================

ManagerX consists of three main components:

**Bot Core (Python)**

Discord.py/py-cord based bot with modular cog system. Handles Discord events, commands, and business logic.

- Location: ``src/bot/``
- Main entry: ``main.py``

**API Server (FastAPI)**

REST API providing bot data to frontend and external services.

- Location: ``src/api/``
- Port: 8040
- Runs in same process as bot

**Web Dashboard (React)**

Modern TypeScript/React frontend with real-time statistics and management interface.

- Location: ``src/web/``
- Port: 8080
- Built with Vite

See :doc:`architecture/index` for detailed architecture documentation.

---

🛠️ Development Environment
============================

**Prerequisites:**

- Python 3.11+
- Node.js 18+ (for web development)
- Git
- SQLite3 (usually included with Python)

**Quick Setup:**

.. code-block:: bash

# Clone repository
git clone https://github.com/ManagerX-Development/ManagerX.git
cd ManagerX

# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\\Scripts\\activate

# Install dependencies
pip install -r requirements/bot_req.txt

# Set up configuration
cp config/config.yaml config/config.local.yaml
# Edit config/config.local.yaml with your settings

# Run the bot
python main.py

For detailed setup, see :doc:`getting_started/index`.

---

📖 Common Development Tasks
============================

**Creating a New Command**

See :doc:`bot_development/index` for complete example

**Adding a Database Table**

See :doc:`database/index` for schema modifications

**Creating an API Endpoint**

See :doc:`api_development/index` for REST endpoint examples

**Writing Tests**

See :doc:`testing/index` for testing patterns

**Deploying to Production**

See :doc:`deployment/index` for deployment procedures

---

🤝 Contributing
================

We welcome contributions! Whether it's bug fixes, new features, or documentation improvements:

1. Fork the repository
2. Create a feature branch: ``git checkout -b feature/amazing-feature``
3. Follow code style (see :doc:`contributing/index`)
4. Write or update tests (see :doc:`testing/index`)
5. Commit with clear messages (see :doc:`contributing/index`)
6. Push and create a Pull Request

See :doc:`contributing/index` for complete contribution guidelines.

---

📊 Project Statistics
======================

- **Language:** Python (bot) + TypeScript (web)
- **Framework:** discord.py + FastAPI + React
- **Database:** SQLite
- **Lines of Code:** 10,000+
- **Cogs/Modules:** 10+
- **API Endpoints:** 20+
- **Commands:** 50+

---

🔗 Quick Navigation
====================

Key Sections:

.. toctree::
:maxdepth: 1
:caption: Getting Started
:hidden:

getting_started
installation
project_structure

.. toctree::
:maxdepth: 1
:caption: Core Concepts
:hidden:

architecture
design_patterns
database_design

.. toctree::
:maxdepth: 1
:caption: Development
:hidden:

bot_development
api_development
frontend_development
testing

.. toctree::
:maxdepth: 1
:caption: Community
:hidden:

contributing
code_style
deployment


Welcome to the
10 changes: 9 additions & 1 deletion src/bot/cogs/moderation/moderation.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
import timedelta
from discord.ui import Container
from discord import SlashCommandGroup

# Importiere zentrale Konstanten
from src.bot.core import (
SUCCESS_COLOR, ERROR_COLOR, WARN_COLOR, INFO_COLOR,
emoji_yes, emoji_no, emoji_warn, emoji_info,
emoji_member, emoji_staff, emoji_summary, emoji_slowmode,
AUTHOR, FLOOTER
)
# ───────────────────────────────────────────────
# >> Cogs
# ───────────────────────────────────────────────
Expand Down Expand Up @@ -126,7 +134,7 @@ def _create_moderation_embed(self, action: str, moderator: discord.Member, targe
if additional_info:
embed.add_field(name=f"{emoji_summary} × Zusätzlich", value=additional_info, inline=False)
if target:
embed.set_footer(text=f"User ID: {target.id}")
embed.set_footer(text=f"User ID: {target.id} | {FLOOTER}")
else:
embed.set_footer(text=FLOOTER)
return embed
Expand Down
11 changes: 10 additions & 1 deletion src/bot/cogs/moderation/warn.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@
from discord import slash_command, Option
import os
import datetime
import datetime
import ezcord
import asyncio
from typing import Optional

# Importiere zentrale Konstanten
from src.bot.core import (
SUCCESS_COLOR, ERROR_COLOR, WARN_COLOR, INFO_COLOR,
emoji_yes, emoji_no, emoji_warn, emoji_info,
emoji_member, emoji_staff, emoji_summary, emoji_slowmode,
emoji_circleinfo, AUTHOR, FLOOTER
)


# ───────────────────────────────────────────────
# >> Cogs
Expand Down Expand Up @@ -98,7 +107,7 @@ def _create_warn_embed(self, action: str, moderator: discord.Member,

def _create_error_embed(self, title: str, message: str) -> discord.Embed:
"""Erstellt ein einheitliches Error-Embed"""
embed = discord.Embed(title=title, color=ERROR_COLOR)
embed = discord.Embed(title=title, color=ERROR_COLOR, timestamp=datetime.datetime.now(datetime.timezone.utc))
embed.set_author(name=AUTHOR)
embed.add_field(name=f"{emoji_no} {title}", value=message, inline=False)
embed.set_footer(text=FLOOTER)
Expand Down
Loading