Added a picture to the renewal menu/ installing module dependencies/ changing the 'my gifts' menu
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -886,18 +886,22 @@ async def complete_key_renewal(
|
||||
if hook_commands:
|
||||
builder = insert_hook_buttons(builder, hook_commands)
|
||||
|
||||
renewal_media_path = "img/pic_renewed.jpg"
|
||||
|
||||
try:
|
||||
if callback_query:
|
||||
await edit_or_send_message(
|
||||
target_message=callback_query.message,
|
||||
text=response_message,
|
||||
reply_markup=builder.as_markup(),
|
||||
media_path=renewal_media_path,
|
||||
)
|
||||
elif waiting_message:
|
||||
await edit_or_send_message(
|
||||
target_message=waiting_message,
|
||||
text=response_message,
|
||||
reply_markup=builder.as_markup(),
|
||||
media_path=renewal_media_path,
|
||||
)
|
||||
else:
|
||||
await bot.send_message(tg_id, response_message, reply_markup=builder.as_markup())
|
||||
|
||||
@@ -138,13 +138,15 @@ def pick_currency(
|
||||
|
||||
|
||||
def fmt_money(amount: Decimal, currency: str, language_code: str | None) -> str:
|
||||
q = _round2(amount)
|
||||
if currency == "USD":
|
||||
q = _round2(amount)
|
||||
s = f"{q:,.2f}"
|
||||
if (language_code or "").startswith("ru"):
|
||||
s = s.replace(",", " ")
|
||||
return f"${s}"
|
||||
s = f"{q:,.2f}".replace(",", " ")
|
||||
|
||||
q = amount.quantize(Decimal("1"), rounding=ROUND_HALF_UP)
|
||||
s = f"{q:,.0f}".replace(",", " ")
|
||||
return f"{s} ₽"
|
||||
|
||||
|
||||
@@ -159,7 +161,7 @@ async def display_price(
|
||||
cur = pick_currency(language_code, user_currency=user_currency, force_currency=force_currency)
|
||||
|
||||
if cur == "RUB":
|
||||
val = _round2(Decimal(str(amount_rub)))
|
||||
val = Decimal(str(amount_rub)).quantize(Decimal("1"), rounding=ROUND_HALF_UP)
|
||||
else:
|
||||
val = await convert_from_rub(Decimal(str(amount_rub)), cur, session=session)
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ async def try_fast_payment_flow(
|
||||
required_amount,
|
||||
getattr(callback_query.from_user, "language_code", None),
|
||||
)
|
||||
text = f"{lead_text}.\n\n{FAST_PAY_CHOOSE_CURRENCY}"
|
||||
text = f"{lead_text}\n\n{FAST_PAY_CHOOSE_CURRENCY}"
|
||||
await state.update_data(
|
||||
temp_key=temp_key,
|
||||
temp_payload=temp_payload,
|
||||
@@ -211,7 +211,7 @@ async def try_fast_payment_flow(
|
||||
)
|
||||
await edit_or_send_message(
|
||||
target_message=callback_query.message,
|
||||
text=f"{lead_text}.\n\n{FAST_PAY_CHOOSE_PROVIDER}",
|
||||
text=f"{lead_text}\n\n{FAST_PAY_CHOOSE_PROVIDER}",
|
||||
reply_markup=keyboard.as_markup(),
|
||||
)
|
||||
return True
|
||||
@@ -280,7 +280,7 @@ async def choose_payment_currency(callback_query: CallbackQuery, state: FSMConte
|
||||
getattr(callback_query.from_user, "language_code", None),
|
||||
force_currency=currency,
|
||||
)
|
||||
text = f"{lead_text}.\n\nВалюта: {currency_label(currency)}\n{FAST_PAY_CHOOSE_PROVIDER}"
|
||||
text = f"{lead_text}\n\nВалюта: {currency_label(currency)}\n{FAST_PAY_CHOOSE_PROVIDER}"
|
||||
await edit_or_send_message(
|
||||
target_message=callback_query.message,
|
||||
text=text,
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user