This commit is contained in:
2021-01-08 15:01:23 +08:00
parent 7e9430a400
commit 17190ff674
3 changed files with 73 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ from random import randrange
from textc import textc
from re import search, I
from rsschecker import RSSCheckerThread
from rsslist import getInlineKeyBoardForRSSList, InlineKeyBoardForRSSList
from rsslist import getInlineKeyBoardForRSSList, InlineKeyBoardForRSSList, getInlineKeyBoardForRSSInList, getTextContentForRSSInList
from usercheck import checkUserPermissionsInChat, UserPermissionsInChatCheckResult
@@ -835,6 +835,31 @@ class callbackQueryHandle(Thread):
'message_id': self._data['message']['message_id']}
self._main._request("deleteMessage", "post", json=di)
return
elif self._inlineKeyBoardForRSSListCommand == InlineKeyBoardForRSSList.Content:
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])
if ind >= len(rssList):
ind = len(rssList) - 1
di['text'] = getTextContentForRSSInList(rssList[ind])
di['parse_mode'] = 'HTML'
di['reply_markup'] = getInlineKeyBoardForRSSInList(
chatId, rssList[ind], ind)
self._main._request("editMessageText", "post", json=di)
self.answer()
return
elif self._inlineKeyBoardForRSSListCommand == InlineKeyBoardForRSSList.BackToList:
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])
di['text'] = '列表如下:'
di['reply_markup'] = getInlineKeyBoardForRSSList(
chatId, rssList, itemIndex=ind)
self._main._request("editMessageText", "post", json=di)
self.answer()
return
else:
self.answer('未知的按钮。')
return