fix(dodo): 修复指令识别有误的问题

修复指令识别有误的问题

Signed-off-by: Ching <loooching@gmail.com>
This commit is contained in:
Ching 2022-01-21 00:54:46 +08:00
parent f3c309e38c
commit e51ab984fd
2 changed files with 8 additions and 3 deletions

View File

@ -97,7 +97,9 @@ class Recipe(models.Model):
"elements": [
{
"tag": "markdown",
"content": "# **%s**\n类型:%s\n难度:%s\n评分:%s" % (self.name, self.display_recipe_type, self.display_difficult, self.display_rate)
"content": "# **%s**\n类型:%s\n评分:%s\n难度:%s" % (
self.name, self.display_recipe_type, self.display_rate,
self.display_difficult)
},
{
"tag": "action",

View File

@ -201,9 +201,12 @@ class RequestHandler(BaseHTTPRequestHandler):
if orig_text.startswith('/'):
redis_cli.set(event_id, int(time.time()), ex=60*60*7)
if orig_text not in ['/last', '/del']:
flag = False
for action_ in ['/deploy ', '/菜谱 ']:
if orig_text.startswith(action_):
flag = True
break
if not flag:
self.msg_compoment(access_token, open_id, '指令错误')
return
if orig_text == '/last':