pull/431/head
midoks 2 years ago
parent 8f19a05755
commit a80d666786
  1. 2
      plugins/tgbot/startup/extend/init_cmd.py
  2. 32
      plugins/tgbot/startup/extend/receive_faq.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帖子主题【不要忘记:冒号】"),
],
)

@ -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

Loading…
Cancel
Save