mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 09:05:04 +08:00
Fix bug of handle_cancellation()
This commit is contained in:
parent
ab4d12d214
commit
635fc70756
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user