From f8faddd93e6a07a1d3b8e88ce161b2676201e442 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Fri, 8 Jan 2021 15:26:20 +0800 Subject: [PATCH] add permissions check --- rssbot.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rssbot.py b/rssbot.py index ab90489..5b6d0c4 100644 --- a/rssbot.py +++ b/rssbot.py @@ -600,6 +600,13 @@ class callbackQueryHandle(Thread): self.answer('错误的按钮数据。') return if self._loc == 0: + if 'message' not in self._data: + self.answer('找不到信息。') + return + if self._data['message']['chat']['type'] != 'private': + if checkUserPermissionsInChat(self._main, self._data['message']['chat']['id'], self._fromUserId) != UserPermissionsInChatCheckResult.OK: + self.answer('您没有权限操作') + return try: self._inlineKeyBoardCommand = InlineKeyBoardCallBack( self._command)