A Telegram bot that helps you say the right thing without escalating conversations.
- Stabilize: Calm, grounded responses to reduce tension
- Clarify: Firm, respectful responses that set clear boundaries
- Close: Direct, composed responses to end conversations cleanly
- Free tier: 1 Stabilize resolve per day
- Paid tier: All goals + paid resolves with one free retry after a paid resolve
- Payments: Telegram Stars invoices (XTR) with HMAC-signed invoice payloads stored in SQLite
- V2 Personal (opt-in): Language + language mode per user
- V2 Groups (opt-in): Admin-only group moderation with paid subscriptions
- V2 Group RAG: Admin-only audit-based queries over moderation history
git clone https://github.com/Justadudeinspace/resolver.git
cd resolver
chmod +x install_resolver.sh
./install_resolver.sh
# If .venv was created (default on Linux/macOS/WSL/proot), activate it:
source .venv/bin/activatecp .env.example .env
# Edit .env with your bot token from @BotFather./run_resolver.shpkg install git python3
chmod +x install_resolver.sh
./install_resolver.sh
# If .venv was created, activate it:
source .venv/bin/activate
./run_resolver.shBOT_TOKEN- Telegram bot token from @BotFatherUSE_LLM-trueorfalseto enable OpenAI usageOPENAI_API_KEY- Optional (only if using LLM)LLM_MODEL- Model name (default:gpt-4o-mini)LLM_TEMPERATURE- Response creativityEMBEDDING_MODEL- Embedding model for audit retrieval (default:text-embedding-3-small)RATE_LIMIT_PER_USER- Requests per minuteMAX_INPUT_LENGTH- Max characters in inputDB_PATH- SQLite path (default:./data/resolver.sqlite3)INVOICE_SECRET- HMAC secret for Telegram Stars invoice payloads (32+ chars)FEATURE_V2_PERSONAL- Enable v2 personal settings (true/false, defaultfalse)FEATURE_V2_GROUPS- Enable v2 group moderation (true/false, defaultfalse)LOG_LEVEL- Logging level (INFO, DEBUG, etc.)
- Python 3.9+
- aiogram v3
- openai v1
- httpx v0.28+
- pydantic v2
- The OpenAI client is created lazily only when LLM usage is enabled and a request is made.
- If
USE_LLM=false,OPENAI_API_KEYis missing, or the client fails to initialize, Resolver falls back to template responses and continues running.
V2 features are opt-in. If the flags are missing, they default to false.
- To enable V2 Personal:
- Set
FEATURE_V2_PERSONAL=true - Users must opt in via the
/settingstoggle before v2 personal options appear.
- Set
- To enable V2 Groups:
- Set
FEATURE_V2_GROUPS=true
- Set
- Stars invoices require enabling Stars monetization in @BotFather.
- The bot uses
currency="XTR"and an emptyprovider_token. - XTR amounts are specified in whole Stars (no minor-unit scaling).
- Buttons open Telegram Stars invoices, and resolves are added only after
successful_paymentvalidation. - Group subscriptions use separate Stars plans and activate only after
successful_payment.
- Invoice payloads are explicit and HMAC-signed:
resolver:v2:<plan_key>:<subject_type>:<subject_id>:<nonce>:<hmac> subject_typeisuserorgroup, andsubject_idis the Telegram user/chat id.INVOICE_SECRET(32+ chars) is required to build and verify payloads.- Invoice context (user, plan key, amount, currency, status, timestamps) is persisted before sending the invoice.
- Idempotency is enforced via
telegram_payment_charge_idrecorded in SQLite.
/start→ choose a goal- Send your text
- Receive 3 response options
- Use Retry modifiers (Softer / Firmer / Shorter)
- Use
/settingsto set a default goal and default tone. - If a default goal is set,
/resolveauto-selects it and prompts for text (tap another goal to switch). - Default tone is applied to the first response set unless you choose a retry modifier.
- When
FEATURE_V2_PERSONAL=true,/settingsalso lets you set:- Language (top 15 languages)
- Language mode: Clean / Adult / Unrestricted
Personal (DM)
- Free tier: 1 Stabilize resolve per day.
- Paid usage (Telegram Stars):
- Personal Monthly: 50 ⭐
- Personal Yearly: 450 ⭐
- Personal Lifetime: 1000 ⭐
- Retry rule: One free retry after a paid resolve; additional retries consume paid resolves.
Group (PLUS, per-group)
- All group features are paid and require an active subscription per group.
- Subscriptions: Group Monthly 150 ⭐, Group Yearly 1500 ⭐, Group Charter 4000 ⭐.
- Charter is one-time, non-refundable, lifetime access.
RAG Add-On (per-group)
- RAG Monthly Add-On: 50 ⭐.
- Requires an active group subscription and explicit add-on entitlement.
Group moderation is admin-only and requires:
FEATURE_V2_GROUPS=true- Group enabled in
/groupadmin - An active subscription
The group admin panel also lets admins set welcome messages, rules text, and security settings per group.
Plans:
- Group Monthly: 150 ⭐ → 30 days
- Group Yearly: 1500 ⭐ → 365 days
- Group Charter: 4000 ⭐ → one-time, non-refundable, lifetime access
Group admins can query audit logs from the admin panel:
- Ask questions like “last 24h incidents” or “why was user X muted?”
- Results are summarized and cite audit IDs (no raw chat history).
- Details can be revealed by admins only via “Show details” buttons.
- RAG requires an active group subscription and the RAG Add-On.
When entitled, triggers follow:
- De-escalation message
- Violation counter increments
- Warn at
warn_threshold - Temporary mute at
mute_threshold(10 minutes)
No auto-bans, no silent moderation, no admin overrides.
DM commands
/start- Begin. Choose a goal and resolve a message./resolve- Resolve a message by choosing a goal and getting clear options./pricing- View Personal and Group pricing./buy- Purchase personal plans with Stars./account- View your remaining resolves and usage./settings- Set your default goal, response style, and language (v2 personal)./help- Learn how to use The Resolver./feedback- Send feedback to improve the bot.
Group commands (admin-only)
/groupadmin- Group control panel and subscription status./grouplogs- View the last 20 moderation actions.
/start
/resolve
/pricing
/buy
/account
/settings
/groupadmin
/grouplogs
/help
/feedback
.
├── app/
│ ├── __init__.py
│ ├── config.py
│ ├── db.py
│ ├── handlers.py
│ ├── languages.py
│ ├── llm.py
│ ├── main.py
│ ├── middlewares.py
│ ├── payments.py
│ ├── pricing.py
│ ├── states.py
│ └── texts.py
├── .env.example
├── .gitignore
├── docs/
│ ├── assets/
│ ├── LAUNCH_CHECKLIST.md
│ ├── MVP_CHECKLIST.md
│ ├── admin_permissions.md
│ ├── launch_readiness_checklist.md
│ ├── resolver.md
│ └── v2_roadmap.md
├── install_resolver.sh
├── LICENSE
├── requirements.txt
├── run_resolver.sh
└── README.md
python -m app.main
python -m compileall app- Added settings defaults for goal/style and applied them to
/resolvewith a Change goal option. - Added a feedback submenu and database logging for feedback messages.
Proprietary - All rights reserved.

