From a1a0c6913c054a29db95c5eed7bf4e9beca84916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Tue, 14 Mar 2023 18:19:29 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20the=20issue=20where=20the?= =?UTF-8?q?=20owner=20cannot=20be=20retrieved?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/admin/post.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/plugins/admin/post.py b/plugins/admin/post.py index 1eb14af5..b420d2cc 100644 --- a/plugins/admin/post.py +++ b/plugins/admin/post.py @@ -97,13 +97,12 @@ class Post(Plugin.Conversation): ] url = f"https://www.miyoushe.com/ys/article/{post_info.post_id}" text = f"发现官网推荐文章 {post_info.subject}\n是否开始处理" - for user in config.admins: - try: - await context.bot.send_message( - user.user_id, text, parse_mode=ParseMode.HTML, reply_markup=InlineKeyboardMarkup(buttons) - ) - except BadRequest as exc: - logger.error("发送消息失败 %s", exc.message) + try: + await context.bot.send_message( + config.owner, text, parse_mode=ParseMode.HTML, reply_markup=InlineKeyboardMarkup(buttons) + ) + except BadRequest as exc: + logger.error("发送消息失败 %s", exc.message) @conversation.entry_point @handler.callback_query(pattern=r"^post_admin\|", block=False)