feat(api): telegram /start webhook with inline Mini App launch button - #56
Merged
Conversation
The bot advertised /start /lang /help but had no handler or webhook, so the
commands were dead. Add POST /telegram/webhook: it validates the
X-Telegram-Bot-Api-Secret-Token header (constant-time, fails closed if the
secret is unset), then replies to /start /help /lang with a trilingual
(ru/uz/en) welcome carrying an inline web_app button that opens the Mini App.
- src/telegram/{schemas,messages,router}.py + registration in main.py
- send_telegram_notification gains an optional reply_markup (backward compatible)
- config: telegram_webhook_secret + telegram_webapp_url
- 11 tests (red->green shown): secret gate, fail-closed, command parsing,
language selection, non-command ignored
- mypy CI extended to src/telegram/; RUF001 per-file-ignore for Cyrillic copy
temrjan
added a commit
that referenced
this pull request
Jul 29, 2026
…ant webhook (#56) (#58) * Revert "feat(api): telegram /start webhook with inline Mini App launch button (#56)" This reverts commit 637d509. * feat(bot): hide AI assistant from /start (demo scope) The existing polling bot exposed the AI assistant — a launch-keyboard button and an "AI assistant" line in every welcome. The demo hides the assistant, so drop the button, its aylin i18n key, and the welcome line in uz/ru/en. The launch keyboard keeps Wallet / Exchange / Staking / Send. Adds test_bot.py (red->green): asserts no assistant word survives in the keyboard or welcome copy, and the wallet launch button still points at the app. --------- Co-authored-by: temrjan <x.temrjan@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Команды бота /start /lang /help были объявлены, но обработчика/вебхука не было — мертвы. Добавлен
POST /telegram/webhook.Что делает
/start/help/lang→ трёхъязычный (ru/uz/en) welcome с inline web_app кнопкой «🥇 Открыть приложение» → app.oltinpay.com.Безопасность (новый внешний вход на funds-api)
X-Telegram-Bot-Api-Secret-Tokenпервым (constant-timehmac.compare_digest); тело парсится только после гейта.Гейты
src/telegram/) ✅ 0 ошибок · pytest 174 passed / 2 skipped ✅Деплой (отдельно, вручную)
Секрет в .env сервера → rebuild api →
setWebhook. + Капитан включает Main Mini App в BotFather для?startapp.