From b56b2ae33a29edca9d78484f87ea6a7c31a29b33 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Mon, 18 Jan 2021 21:49:12 +0800 Subject: [PATCH] do more check --- RSSEntry.py | 2 +- rssbot.py | 7 +++++++ rsslist.py | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/RSSEntry.py b/RSSEntry.py index f133f0e..0fd4125 100644 --- a/RSSEntry.py +++ b/RSSEntry.py @@ -136,7 +136,7 @@ class RSSEntry: self.lasterrortime = None if data is not None and data[5] is not None: self.lasterrortime = data[5] - self.forceupdate = None + self.forceupdate = False if data is not None and data[6] is not None: self.forceupdate = bool(data[6]) self.chatList = [] diff --git a/rssbot.py b/rssbot.py index bd7697d..1c7299d 100644 --- a/rssbot.py +++ b/rssbot.py @@ -1157,6 +1157,8 @@ class callbackQueryHandle(Thread): self._main._request("editMessageText", "post", json=di) return elif self._inlineKeyBoardForRSSListCommand == InlineKeyBoardForRSSList.ForceUpdate: + di = {'chat_id': self._data['message']['chat']['id'], + 'message_id': self._data['message']['message_id']} rssList = self._main._db.getRSSListByChatId(chatId) ind = int(self._inputList[3]) ind = max(min(ind, len(rssList)), 0) @@ -1164,6 +1166,11 @@ class callbackQueryHandle(Thread): self.answer('已发送强制更新请求。') else: self.answer('发送强制更新请求失败。') + di['text'] = getTextContentForRSSInList(rssList[ind]) + di['parse_mode'] = 'HTML' + di['reply_markup'] = getInlineKeyBoardForRSSSettingsInList( + chatId, rssList[ind], ind) + self._main._request("editMessageText", "post", json=di) return else: self.answer('未知的按钮。') diff --git a/rsslist.py b/rsslist.py index b9a1da7..331dbd3 100644 --- a/rsslist.py +++ b/rsslist.py @@ -122,7 +122,7 @@ def getInlineKeyBoardForRSSInList(chatId: int, rssEntry: RSSEntry, index: int, i i = i + 1 d[i].append( {'text': '取消订阅', 'callback_data': f'1,{chatId},{InlineKeyBoardForRSSList.Unsubscribe.value},{index}'}) - if isOwner: + if not rssEntry.forceupdate and isOwner: d.append([]) i = i + 1 d[i].append(