mirror of
https://github.com/BEDOLAGA-DEV/remnawave-bedolaga-telegram-bot.git
synced 2026-05-04 20:15:56 +00:00
Update purchase.py
This commit is contained in:
@@ -9,7 +9,7 @@ from urllib.parse import quote
|
||||
from aiogram import Dispatcher, types, F
|
||||
from aiogram.exceptions import TelegramBadRequest
|
||||
from aiogram.fsm.context import FSMContext
|
||||
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
||||
from aiogram.types import InaccessibleMessage, InlineKeyboardMarkup, InlineKeyboardButton
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from app.config import settings, PERIOD_PRICES, get_traffic_prices
|
||||
from app.database.crud.discount_offer import (
|
||||
@@ -1331,6 +1331,15 @@ async def _edit_message_text_or_caption(
|
||||
) -> None:
|
||||
"""Edits message text when possible, falls back to caption or re-sends message."""
|
||||
|
||||
# Если сообщение недоступно, отправляем новое
|
||||
if isinstance(message, InaccessibleMessage):
|
||||
await message.answer(
|
||||
text,
|
||||
reply_markup=reply_markup,
|
||||
parse_mode=parse_mode,
|
||||
)
|
||||
return
|
||||
|
||||
try:
|
||||
await message.edit_text(
|
||||
text,
|
||||
|
||||
Reference in New Issue
Block a user