Add multi-user features: i18n, payments, multi-model AI, focus areas

Replace single report type with composable analysis: depth levels
(basic/standard/full) + focus area multi-select (psychology, business,
marketing, content, audience, sentiment). Multi-step inline keyboard
flow guides users through selection.

- i18n: English + Russian, auto-detect from Telegram, /lang override
- AI providers: Anthropic + OpenRouter via AIClient abstraction
- Telegram Stars payments with per-depth pricing and free trial
- SQLite (aiosqlite) for users, analyses, payments tracking
- User middleware for auto-registration and language detection
- Report persistence: save .md locally, offer file download
- New commands: /features, /prices, /lang
- Composable prompt system: depth modifiers + focus area fragments
This commit is contained in:
Sergei Poljanski 2026-02-23 01:18:12 +02:00
commit c30b7e4675
27 changed files with 1155 additions and 280 deletions

View file

@ -0,0 +1,74 @@
from bot.models import FocusArea
FOCUS_CHUNK_BULLETS: dict[FocusArea, str] = {
FocusArea.PSYCHOLOGY: (
"- Persuasion and influence techniques used\n"
"- Cognitive biases leveraged (scarcity, social proof, authority, etc.)\n"
"- Emotional triggers and manipulation patterns\n"
"- Framing and narrative control techniques"
),
FocusArea.BUSINESS: (
"- Revenue models and monetization strategies\n"
"- Product/service placement and promotion patterns\n"
"- Conversion funnels and calls-to-action\n"
"- Pricing psychology and offer structuring"
),
FocusArea.MARKETING: (
"- Growth tactics and audience acquisition strategies\n"
"- Viral mechanics and shareability factors\n"
"- Cross-promotion and collaboration patterns\n"
"- Brand positioning and differentiation"
),
FocusArea.CONTENT: (
"- Main topics and themes discussed\n"
"- Content formats (long-form, short updates, lists, media, etc.)\n"
"- Posting frequency and schedule patterns\n"
"- Narrative arcs and series/recurring segments\n"
"- Content quality and originality assessment"
),
FocusArea.AUDIENCE: (
"- Engagement patterns (views, forwards, replies per content type)\n"
"- Audience interaction and community dynamics\n"
"- Top-performing vs underperforming content\n"
"- Engagement drivers and detractors"
),
FocusArea.SENTIMENT: (
"- Overall sentiment distribution (positive/negative/neutral)\n"
"- Sentiment breakdown by topic\n"
"- Emotional tone shifts over time\n"
"- Controversial or polarizing content identification"
),
}
FOCUS_SYNTHESIS_SECTIONS: dict[FocusArea, str] = {
FocusArea.PSYCHOLOGY: (
"## Psychology & Influence\n"
"Analyze persuasion techniques, cognitive biases, emotional triggers, "
"and manipulation patterns found across the channel's content."
),
FocusArea.BUSINESS: (
"## Business & Monetization\n"
"Detail revenue models, monetization strategies, product placements, "
"conversion patterns, and business-related content."
),
FocusArea.MARKETING: (
"## Marketing & Growth\n"
"Assess growth tactics, viral mechanics, cross-promotion strategies, "
"and brand positioning approaches."
),
FocusArea.CONTENT: (
"## Content Strategy\n"
"Analyze topics, formats, posting patterns, narrative arcs, "
"content quality, and overall editorial strategy."
),
FocusArea.AUDIENCE: (
"## Audience & Engagement\n"
"Deep dive into engagement metrics, audience interaction patterns, "
"community dynamics, and what drives or kills engagement."
),
FocusArea.SENTIMENT: (
"## Sentiment Analysis\n"
"Present sentiment distribution, emotional tone analysis, "
"sentiment by topic, and shifts over time."
),
}