From 635fc70756b7397898d1b5913832375456cacee1 Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Thu, 21 Feb 2019 22:20:31 +0800 Subject: [PATCH] Fix bug of handle_cancellation() --- nonebot/command/argfilter/controllers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nonebot/command/argfilter/controllers.py b/nonebot/command/argfilter/controllers.py index b8b57173..e89d4909 100644 --- a/nonebot/command/argfilter/controllers.py +++ b/nonebot/command/argfilter/controllers.py @@ -10,7 +10,7 @@ def handle_cancellation(session: CommandSession): """ def control(value): - if _is_cancellation(value): + if _is_cancellation(value) is True: session.finish(render_expression( session.bot.config.SESSION_CANCEL_EXPRESSION)) return value @@ -18,7 +18,7 @@ def handle_cancellation(session: CommandSession): return control -async def _is_cancellation(sentence: str) -> bool: +def _is_cancellation(sentence: str) -> bool: for kw in ('算', '别', '不', '停', '取消'): if kw in sentence: # a keyword matches