🎨 Update Error Handler for Send User Notification

This commit is contained in:
洛水居室 2023-02-21 09:27:01 +08:00
parent 9d8d6deda7
commit f67eb74c04
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -48,8 +48,8 @@ async def send_user_notification(update: Update, context: CallbackContext, text:
await update.callback_query.answer(text, show_alert=True) await update.callback_query.answer(text, show_alert=True)
return None return None
return await message.reply_text(text, reply_markup=buttons, allow_sending_without_reply=True) return await message.reply_text(text, reply_markup=buttons, allow_sending_without_reply=True)
except ConnectTimeout: except TimedOut:
logger.error("httpx 模块连接服务器 ConnectTimeout 发送 update_id[%s] 错误信息失败", update.update_id) logger.error("发送 update_id[%s] 错误信息失败 连接超时", update.update_id)
except BadRequest as exc: except BadRequest as exc:
logger.error("发送 update_id[%s] 错误信息失败 错误信息为 [%s]", update.update_id, exc.message) logger.error("发送 update_id[%s] 错误信息失败 错误信息为 [%s]", update.update_id, exc.message)
except Forbidden as exc: except Forbidden as exc: