fix(bot): connect button opens subscription page instead of mini app

Previously the connect button in post-payment messages and in 'My subscription' section opened the mini app (personal cabinet) when SUBSCRIPTION_MINI_APP_URL was set, ignoring the actual subscription URL. Now the real subscription URL is preferred, with the mini app used only as a fallback.
This commit is contained in:
3252a8
2026-04-27 11:06:32 +03:00
parent e35885b54b
commit 587b39de1d
2 changed files with 15 additions and 16 deletions
+5 -5
View File
@@ -444,17 +444,17 @@ def get_connect_and_main_keyboard(
builder = InlineKeyboardBuilder()
button_target = connect_button_url or config_link
if settings.SUBSCRIPTION_MINI_APP_URL:
if button_target:
builder.row(
InlineKeyboardButton(text=_("connect_button"), url=button_target)
)
elif settings.SUBSCRIPTION_MINI_APP_URL:
builder.row(
InlineKeyboardButton(
text=_("connect_button"),
web_app=WebAppInfo(url=settings.SUBSCRIPTION_MINI_APP_URL),
)
)
elif button_target:
builder.row(
InlineKeyboardButton(text=_("connect_button"), url=button_target)
)
else:
builder.row(
InlineKeyboardButton(