From a80d666786573d3e37c78044cf40941e599def46 Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 24 Jul 2023 23:52:38 +0800 Subject: [PATCH] update --- plugins/tgbot/startup/extend/init_cmd.py | 2 +- plugins/tgbot/startup/extend/receive_faq.py | 32 +++++++++------------ 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/plugins/tgbot/startup/extend/init_cmd.py b/plugins/tgbot/startup/extend/init_cmd.py index 26958d6fa..d291118af 100644 --- a/plugins/tgbot/startup/extend/init_cmd.py +++ b/plugins/tgbot/startup/extend/init_cmd.py @@ -22,6 +22,6 @@ def init(bot): bot.set_my_commands( commands=[ telebot.types.BotCommand("start", "查看帮助信息"), - telebot.types.BotCommand("faq", "查看bbs帖子主题【不要忘记:冒号】"), + telebot.types.BotCommand("?:", "查看bbs帖子主题【不要忘记:冒号】"), ], ) diff --git a/plugins/tgbot/startup/extend/receive_faq.py b/plugins/tgbot/startup/extend/receive_faq.py index 0a9e7ab23..6b619af86 100644 --- a/plugins/tgbot/startup/extend/receive_faq.py +++ b/plugins/tgbot/startup/extend/receive_faq.py @@ -189,26 +189,22 @@ def run(bot, message): return bot # print(text_body) - if isThisCmd('/faq:', text_body): - cmd_text = getReadCmd('/faq:', text_body) + if isThisCmd('/?:', text_body): + cmd_text = getReadCmd('/?:', text_body) return searchFaq(bot, message, cmd_text) - # if isThisCmd('/debug', text_body): - # cmd_text = getReadCmd('/debug', text_body) - # return searchDebug(bot, message, cmd_text) - - if text_body.find('?') > -1 or text_body.find('?') > -1: - return_msg = "你似乎在寻找【" + text_body + "】答案:\n" - return_msg += "/faq:开始寻找你的问题\n" - keyboard = [ - [ - types.InlineKeyboardButton( - text="如未找到,可以在论坛补充你的提问!", url='https://bbs.midoks.me'), - ] - - ] - markup = types.InlineKeyboardMarkup(keyboard) - bot.reply_to(message, return_msg, reply_markup=markup) + # if text_body.find('?') > -1 or text_body.find('?') > -1: + # return_msg = "你似乎在寻找【" + text_body + "】答案:\n" + # return_msg += "/faq:开始寻找你的问题\n" + # keyboard = [ + # [ + # types.InlineKeyboardButton( + # text="如未找到,可以在论坛补充你的提问!", url='https://bbs.midoks.me'), + # ] + + # ] + # markup = types.InlineKeyboardMarkup(keyboard) + # bot.reply_to(message, return_msg, reply_markup=markup) return bot