🐛 Fix post plugin send error to owner

This commit is contained in:
xtaodada 2024-04-23 19:52:33 +08:00
parent 53cb3b53b5
commit 45df5e2cc3
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -120,11 +120,10 @@ class Post(Plugin.Conversation):
except APIHelperException as exc:
logger.error("获取文章信息失败 %s", str(exc))
text = f"获取 post_id[{post_id}] 文章信息失败 {str(exc)}"
for user in config.admins:
try:
await context.bot.send_message(user.user_id, text)
except BadRequest as _exc:
logger.error("发送消息失败 %s", _exc.message)
try:
await context.bot.send_message(config.owner, text)
except BadRequest as _exc:
logger.error("发送消息失败 %s", _exc.message)
return
buttons = [
[