mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-25 09:37:30 +00:00
🎨 Add to schedule for deletion after sending exception information
This commit is contained in:
parent
06ff5d9bcd
commit
7b62d86f46
@ -10,7 +10,7 @@ from httpx import HTTPError, TimeoutException
|
|||||||
from telegram import ReplyKeyboardRemove, Update, InlineKeyboardMarkup, InlineKeyboardButton
|
from telegram import ReplyKeyboardRemove, Update, InlineKeyboardMarkup, InlineKeyboardButton
|
||||||
from telegram.constants import ParseMode
|
from telegram.constants import ParseMode
|
||||||
from telegram.error import BadRequest, Forbidden, TelegramError, TimedOut, NetworkError
|
from telegram.error import BadRequest, Forbidden, TelegramError, TimedOut, NetworkError
|
||||||
from telegram.ext import CallbackContext, ApplicationHandlerStop
|
from telegram.ext import CallbackContext, ApplicationHandlerStop, filters
|
||||||
from telegram.helpers import create_deep_linked_url
|
from telegram.helpers import create_deep_linked_url
|
||||||
|
|
||||||
from core.config import config
|
from core.config import config
|
||||||
@ -83,8 +83,10 @@ class ErrorHandler(Plugin):
|
|||||||
try:
|
try:
|
||||||
if update.callback_query:
|
if update.callback_query:
|
||||||
await update.callback_query.answer(content, show_alert=True)
|
await update.callback_query.answer(content, show_alert=True)
|
||||||
return None
|
reply_text = await message.reply_text(content, reply_markup=buttons, allow_sending_without_reply=True)
|
||||||
return await message.reply_text(content, reply_markup=buttons, allow_sending_without_reply=True)
|
if filters.ChatType.GROUPS.filter(reply_text):
|
||||||
|
self.add_delete_message_job(reply_text, context=context)
|
||||||
|
self.add_delete_message_job(message, context=context)
|
||||||
except TelegramError as exc:
|
except TelegramError as exc:
|
||||||
logger.error(self.SEND_MSG_ERROR_NOTICE, update.update_id, exc.message)
|
logger.error(self.SEND_MSG_ERROR_NOTICE, update.update_id, exc.message)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
|
Loading…
Reference in New Issue
Block a user