You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+
## Project Overview
6
+
7
+
Modmail v5 is a complete rewrite of the Modmail Discord bot (alpha/WIP). It manages support tickets between users and Discord server staff via DM-based modmail. Requires Python 3.14+, uses `uv` as the package manager.
**Database Abstraction**: `DBClientBase` in `backends/common/client_base.py` defines the interface. Both SQL and MongoDB clients implement this. The active backend is selected via `config.yaml`.
70
+
71
+
**Ticket Flow**:
72
+
1. User DMs bot → `cogs/modmail/listeners/dm_receive.py` intercepts
73
+
2.`core/internals/staff_guild.py` creates a channel or forum thread in the staff server
74
+
3. Database stores ticket state via the active backend client
75
+
4. Staff reply via commands in `cogs/modmail/commands/`
76
+
77
+
**Localization**: Fluent FTL format (`locales/en/main.ftl`). All user-facing strings go through `core/translator.py`. Commands use `LazyHybridCommand` (`core/internals/command.py`) supporting both prefix and slash commands.
78
+
79
+
**Cog Base**: Custom `Cog` class in `core/internals/cog.py` with enhanced send/reply helpers and access to the translator.
80
+
81
+
### Config
82
+
Copy `config.yaml.example` → `config.yaml`. Required fields: `bot.token`, `bot.staff_server_id`, `log_url`. Database backend is configured under the `database` key.
83
+
84
+
### Testing Notes
85
+
Tests are currently undergoing a rewrite. Pyright runs in strict mode but excludes the `tests/` directory. Pre-commit hooks enforce isort + ruff formatting on every commit.
0 commit comments