fix(dodo): 修复指令识别有误的问题
修复指令识别有误的问题 Signed-off-by: Ching <loooching@gmail.com>
This commit is contained in:
parent
f3c309e38c
commit
e51ab984fd
@ -97,7 +97,9 @@ class Recipe(models.Model):
|
|||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"tag": "markdown",
|
"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",
|
"tag": "action",
|
||||||
|
|||||||
@ -201,11 +201,14 @@ class RequestHandler(BaseHTTPRequestHandler):
|
|||||||
if orig_text.startswith('/'):
|
if orig_text.startswith('/'):
|
||||||
redis_cli.set(event_id, int(time.time()), ex=60*60*7)
|
redis_cli.set(event_id, int(time.time()), ex=60*60*7)
|
||||||
if orig_text not in ['/last', '/del']:
|
if orig_text not in ['/last', '/del']:
|
||||||
|
flag = False
|
||||||
for action_ in ['/deploy ', '/菜谱 ']:
|
for action_ in ['/deploy ', '/菜谱 ']:
|
||||||
if orig_text.startswith(action_):
|
if orig_text.startswith(action_):
|
||||||
|
flag = True
|
||||||
break
|
break
|
||||||
self.msg_compoment(access_token, open_id, '指令错误')
|
if not flag:
|
||||||
return
|
self.msg_compoment(access_token, open_id, '指令错误')
|
||||||
|
return
|
||||||
if orig_text == '/last':
|
if orig_text == '/last':
|
||||||
try:
|
try:
|
||||||
statuses = mastodon_cli.account_statuses(KEDAI_ID, limit=1)
|
statuses = mastodon_cli.account_statuses(KEDAI_ID, limit=1)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user