From 8c7213d508598ef6905be3156632187438d05bf6 Mon Sep 17 00:00:00 2001 From: brucewzj99 Date: Sun, 12 May 2024 23:43:42 +0800 Subject: [PATCH] added print for vercel logging --- bot/error_handler.py | 1 + bot/telegram_bot.py | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bot/error_handler.py b/bot/error_handler.py index 50356b5..a58edad 100644 --- a/bot/error_handler.py +++ b/bot/error_handler.py @@ -11,6 +11,7 @@ def __init__(self, error_class, message="An error occurred", extra_info=""): self.extra_info = extra_info self.error_class = error_class logging.error(f"{error_class}: {message} {extra_info}") + print(f"{error_class}: {message} {extra_info}") super().__init__(f"{self.error_class}: {self.message}") class GoogleSheetError(BaseError): diff --git a/bot/telegram_bot.py b/bot/telegram_bot.py index b4a5cb1..5a3c77a 100644 --- a/bot/telegram_bot.py +++ b/bot/telegram_bot.py @@ -1080,15 +1080,16 @@ def notify_all(update, context): def notify_preview(update, context): query = update.callback_query query.answer() - query.edit_message_text( - text=f"Sending message to all in progress...", - reply_markup=InlineKeyboardMarkup([]), - ) + try: if ( query.data == "confirm_send" and str(update.effective_user.id) == MASTER_TELE_ID ): + query.edit_message_text( + text=f"Sending message to all in progress...", + reply_markup=InlineKeyboardMarkup([]), + ) new_feature_message = query.message.text.partition("\n")[2] no_of_users, no_of_error_users, error_message = send_new_feature_message( context, new_feature_message