Short invite link service & custom username bot for Delta Chat
  • Python 96.2%
  • Shell 3.2%
  • Dockerfile 0.6%
Find a file
2026-07-25 00:59:25 +03:00
.github/workflows docs: remove MIT license, add support/mirror links, and add ntfy-changelog workflow 2026-07-24 23:58:25 +03:00
tests fix: allow /initadmin to link admin fingerprint when sender email matches pre-configured admin_dc_email 2026-07-25 00:31:38 +03:00
.dockerignore feat: initial release of Delta Chat Username Bot (v1.0.0) 2026-07-24 23:49:54 +03:00
.env.example feat: add DISPLAY_NAME, STATUS_TEXT, and AVATAR_PATH profile configuration 2026-07-25 00:28:43 +03:00
.gitignore feat: initial release of Delta Chat Username Bot (v1.0.0) 2026-07-24 23:49:54 +03:00
bot.py fix: align group chat detection logic with standard multi-fallback implementation across repository bots 2026-07-25 00:59:25 +03:00
Caddyfile feat: initial release of Delta Chat Username Bot (v1.0.0) 2026-07-24 23:49:54 +03:00
CHANGELOG.md feat: initial release of Delta Chat Username Bot (v1.0.0) 2026-07-24 23:49:54 +03:00
database.py fix: sanitize cryptographic fingerprint parsing and filter out invite URL substrings 2026-07-25 00:35:43 +03:00
docker-compose.yml feat: add DISPLAY_NAME, STATUS_TEXT, and AVATAR_PATH profile configuration 2026-07-25 00:28:43 +03:00
Dockerfile feat: initial release of Delta Chat Username Bot (v1.0.0) 2026-07-24 23:49:54 +03:00
favicon.ico feat: generate favicon.ico from icon.png and serve via FastAPI /favicon.ico 2026-07-25 00:54:22 +03:00
icon.png feat: add icon.png and remove short links format string from landing page footer 2026-07-25 00:52:12 +03:00
README.md feat: add icon.png and remove short links format string from landing page footer 2026-07-25 00:52:12 +03:00
requirements.txt feat: initial release of Delta Chat Username Bot (v1.0.0) 2026-07-24 23:49:54 +03:00
set_admin.py feat: initial release of Delta Chat Username Bot (v1.0.0) 2026-07-24 23:49:54 +03:00
update.sh feat: initial release of Delta Chat Username Bot (v1.0.0) 2026-07-24 23:49:54 +03:00

🔗 Delta Chat Username & Short Link Bot (deltachat_username)

A Delta Chat bot and FastAPI web service for registering custom usernames and generating short invite links (https://d.gluek.info/<username>) that redirect (via HTTP 307 Temporary Redirect) to standard Delta Chat invite URLs (https://i.delta.chat/#...).


Features

  • 👤 Custom Usernames: Claim a short username (/username myname) for your personal profile or group chat.
  • Group Chat Auto-Binding: Use /username myname directly inside any group chat — the bot instantly generates the group's invite URL without manual link pasting.
  • 🔀 HTTP 307 Temporary Redirect: Guarantees browsers and proxies always fetch the newest invite link without aggressive caching.
  • 🌐 Web Landing Page: Beautiful dark-mode glassmorphism interface on GET / displaying bot description, QR code, and interactive command hints.
  • 🛡️ Secure Administration: Authenticate ownership via /initadmin with cryptographic fingerprint verification.
  • 📡 Multi-Transport & Statistics: Track sent/received relay stats and configure backup transports.

🚀 Quick Start & Deployment

1. Build Container

Clone repository and navigate to deltachat_username:

cd deltachat_username
cp .env.example .env
docker compose build

2. Initialize Delta Chat Account

Initialize the bot's account in Delta Chat CLI (deltabot-cli):

# Option A: Automatic setup on a Chatmail server (e.g. chatmail.uk or nine.testrun.org)
docker compose run --rm username_bot python bot.py init usernamebot@chatmail.uk

# Option B: Standard email account with password
docker compose run --rm username_bot python bot.py init usernamebot@yourdomain.com "your_password"

3. (Optional) Pre-configure Admin Email / Fingerprint

docker compose run --rm username_bot python set_admin.py --email admin@yourdomain.com

4. Launch Bot Daemon

docker compose up -d

5. Claim Administrative Ownership

Send /initadmin to the bot in a private message in Delta Chat to complete admin identity verification.


🤖 Bot Commands

Command Scope Description
/username All Check current registered username and short link.
/username <name> All Claim or update a username (min 5 chars).
/help All Show command help and bot info.
/donate All Support bot development.
/initadmin Admin Claim administrative ownership.
/url <url> Admin Set base domain URL (https://d.gluek.info).
/stats Admin Show registered usernames and database stats.
/transports Admin List configured mail relays and statistics.

🌐 Caddy Configuration

Add to your /etc/caddy/Caddyfile:

d.gluek.info {
    reverse_proxy 127.0.0.1:8080
}

🧪 Running Unit Tests

python3 -m unittest discover -s tests -p "test_*.py" -v

❤️ Support & Development

If you find this bot useful, consider supporting its development: