From 43c4e7e3e3a74728062c20bdd664cee1fae667d8 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Wed, 7 Sep 2022 03:21:10 +0000 Subject: [PATCH] =?UTF-8?q?=E9=A2=91=E9=81=93=EF=BC=9A=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E4=B8=8D=E9=9C=80=E8=A6=81=E7=9A=84=E6=9D=83=E9=99=90=E6=A3=80?= =?UTF-8?q?=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rssbot.py | 4 +--- usercheck.py | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/rssbot.py b/rssbot.py index 9aa3b52..0f0046e 100644 --- a/rssbot.py +++ b/rssbot.py @@ -1129,8 +1129,6 @@ class messageHandle(Thread): continue if re2['type'] == 'channel' and chatMember['status'] == 'administrator' and ('can_post_messages' not in chatMember or not chatMember['can_post_messages']): continue - if re2['type'] == 'channel' and chatMember['status'] == 'administrator' and ('can_edit_messages' not in chatMember or not chatMember['can_edit_messages']): - continue chatM = chatMember if chatM is None: di['text'] = '你没有权限操作。' @@ -1144,7 +1142,7 @@ class messageHandle(Thread): "chat_id": chatId, "user_id": self._main._me['id']}) if re4 is not None and 'ok' in re4 and re4['ok']: re4 = re4['result'] - if re2['type'] == 'channel' and (re4['status'] not in ['creator', 'administrator'] or not re4['can_post_messages'] or not re4['can_edit_messages']): + if re2['type'] == 'channel' and (re4['status'] not in ['creator', 'administrator'] or not re4['can_post_messages']: di['text'] = '机器人在频道内缺少必要的权限' self._main._request( 'editMessageText', 'post', json=di) diff --git a/usercheck.py b/usercheck.py index a385d4f..b6ed268 100644 --- a/usercheck.py +++ b/usercheck.py @@ -45,7 +45,5 @@ def checkUserPermissionsInChat(m, chatId: int, userId: int) -> UserPermissionsIn continue if chatInfo['type'] == 'channel' and chatMember['status'] == 'administrator' and ('can_post_messages' not in chatMember or not chatMember['can_post_messages']): continue - if chatInfo['type'] == 'channel' and chatMember['status'] == 'administrator' and ('can_edit_messages' not in chatMember or not chatMember['can_edit_messages']): - continue return UserPermissionsInChatCheckResult.OK return UserPermissionsInChatCheckResult.NoPermissions