The first version of the SupportMail Discord bot. It handles modmail via DM-to-forum tickets, message reports, per-guild blacklists, a premium/subscription tier, webhook-based logging, and localization in three languages.
This was my first real programming project — written while learning Python — and is published for display only. It no longer runs against current library versions and is not maintained. Superseded by v2, a full rewrite in TypeScript / discord.js.
- Python 3.11, discord.py-based
aiosqlite— four separate SQLite databases (config, tickets, reports, logging)gettextlocalization (en / de / fr), with a DeepL-backed translation featurehttpx,pytz,python-dateutil
| Path | What |
|---|---|
main.py |
Entry point — cog loader, crash handler |
ext/_1_tickets/ |
DM ↔ forum-post ticket handling, edits, interactions |
ext/_2_reports/ |
Message-report creation and moderation actions |
ext/_3_commands/ |
Slash commands (setup, team, blacklist, public, help, …) |
ext/_4_misc/ |
Database setup, premium, data management |
utils/sm_api.py |
Core bot logic (tickets, logging, premium, webhooks) |
utils/translations.py |
gettext wrapper for i18n |
utils/ (*.py) |
Models, enums, error types, shared helpers |
Translations/ |
gettext .po sources per feature |
Copy the example config and fill in the keys:
cp config.example.json config.json| Key | Purpose |
|---|---|
DC_KEY1 |
Discord bot token (the token used to run) |
DC_KEY |
Secondary Discord token |
DEEPL_KEY |
DeepL API key (translation feature) |
TOPGG_KEY |
Top.gg API key (stats posting) |
CRASH_WEBHOOK |
Discord webhook URL for crash alerts (optional) |
- Fill in
config.json(above). - Provide the SQLite databases the code expects (not included).
python main.py
Why DC_KEY1 and DC_KEY?
This was my first real project - I used to manually change the name of the bot token used to run the bot - one was for dev, one was for prod. I just changed the name of the key in the code when I was developing.
Note: secrets, databases, and runtime logs are intentionally excluded (see
.gitignore). This repo is a code sample, not a deployable build.