From cc2645aa9d66ddb6d29aa8076b33cd84ba9f5061 Mon Sep 17 00:00:00 2001 From: Cinte Date: Mon, 22 Aug 2022 12:34:21 +0800 Subject: [PATCH] Update word_handle.py --- plugins/word_bank/word_handle.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/word_bank/word_handle.py b/plugins/word_bank/word_handle.py index 7356d66b..c84cc5bc 100644 --- a/plugins/word_bank/word_handle.py +++ b/plugins/word_bank/word_handle.py @@ -117,10 +117,11 @@ async def _( answer = event.message[index:] answer[0] = str(answer[0])[str(answer[0]).index('答')+1:] _problem[0] = str(_problem[0])[str(_problem[0]).index('问')+1:] - if _problem[-1].type == 'at' and seg.data['text'][:seg.data['text'].index('答')].lstrip(): - _problem.append(seg.data['text'][:seg.data['text'].index('答')]) - else: - _problem.append(seg.data['text'][:seg.data['text'].index('答')].lstrip()) + if _problem[-1].type == 'at': + if seg.data['text'][:seg.data['text'].index('答')].lstrip(): + _problem.append(seg.data['text'][:seg.data['text'].index('答')]) + else: + _problem.append(seg.data['text'][:seg.data['text'].index('答')].lstrip()) temp = '' for g in _problem: if isinstance(g, str):