Bot interface for mail.thc.org: manage email aliases across messaging platforms by @ohmymex
- TypeScript 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| src | ||
| .env.example | ||
| .gitignore | ||
| agmh.txt | ||
| bun.lock | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
mail-forwarding-bot
Bot interface for mail.thc.org - manage email aliases across messaging platforms.
Powered by Haltman.io and The Hacker's Choice.
Platforms
| Platform | Status |
|---|---|
| Telegram | Live |
| Discord | Live |
| TODO |
Requirements
- Bun v1.0+
Setup
git clone https://github.com/ohmymex/mail-forwarding-bot
cd mail-forwarding-bot
bun install
cp .env.example .env
Fill in your tokens in .env, then run:
bun run setup
Running
# Telegram only
bun run telegram
# Discord only
bun run discord
# All platforms
bun run all
For Discord, register slash commands first:
bun run deploy:discord
Commands
Telegram supports an interactive /menu panel with inline buttons. Discord supports an interactive /menu panel with embeds, buttons, select menus, and modals.
Menu
| Command | Description |
|---|---|
/menu |
Open the interactive control panel |
Account
| Command | Description |
|---|---|
/setup <email> |
Start new API key creation for an email |
/confirm <token> |
Confirm and link a new API key |
/link_token <api_key> |
Link an existing API key and detect its email from the API |
/whoami |
Show your linked emails |
Alias
| Command | Description |
|---|---|
/domains |
List available domains |
/create <name> <domain> [email] |
Create an alias, optionally choosing which linked email/API key forwards mail |
/delete <alias> [email] |
Delete an alias |
/list [page] [email] |
List your aliases |
/stats [email] |
Your alias stats |
Handle
A handle lets you claim a username once and receive mail at username@every-domain.
| Command | Description |
|---|---|
/handle <username> [email] |
Claim a handle |
/handle_delete <handle> [email] |
Deactivate a handle |
/handle_disable <handle> <domain> [email] |
Disable a specific domain |
/handle_enable <handle> <domain> [email] |
Enable a specific domain |
Existing API keys must match the bot's local format check: exactly 64 lowercase letters or digits. The bot verifies the key with /api/alias/list?limit=1&offset=0 and stores the returned goto email.
Config
| Variable | Required | Description |
|---|---|---|
HALTMAN_BASE_URL |
No | API base URL (default: https://mail.thc.org) |
HALTMAN_BOT_AUTH_TOKEN |
Yes | Bot auth token sent in the X-Bot-Auth-Token header on every API request |
TELEGRAM_BOT_TOKEN |
For Telegram | Bot token from @BotFather |
DISCORD_BOT_TOKEN |
For Discord | Bot token from Discord Developer Portal |
DISCORD_CLIENT_ID |
Optional | Application ID from Discord Developer Portal; deploy auto-detects the application from the bot token and warns on mismatch |
DISCORD_GUILD_ID |
Optional | Guild ID used to also register guild-scoped slash commands for immediate testing |
Stack
- Runtime: Bun
- Telegram: grammY
- Discord: discord.js
- Storage: SQLite via
bun:sqlite - API: mail.thc.org
Community
- THC: https://t.me/thcorg
- Haltman: https://t.me/haltman_group
License
MIT