From 0ee89ac7d48f30ac3f15bb41464eb8c410e5c5b7 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Mon, 28 Jun 2021 13:51:17 +0800 Subject: [PATCH] =?UTF-8?q?kongge=20=E5=81=9C=E6=AD=A2=E7=BB=B4=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kongge.py | 19 +++++++++++-------- list.json | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/kongge.py b/kongge.py index de5360e..e5e97a7 100644 --- a/kongge.py +++ b/kongge.py @@ -10,11 +10,14 @@ except ImportError: @listener(is_plugin=True, outgoing=True, ignore_edited=True) async def kongge(context): - if jieba_imported and context.text and not context.via_bot and not context.forward: - if context.text.startswith('-') or context.text.startswith('/'): - return - seg_list = jieba.cut(context.text) - seg_txt = ' '.join(seg_list) - seg_txt.replace('@ ', '@') - if not seg_txt == context.text: - await context.edit(seg_txt) + try: + if jieba_imported and context.text and not context.via_bot and not context.forward: + if context.text.startswith('-') or context.text.startswith('/'): + return + seg_list = jieba.cut(context.text) + seg_txt = ' '.join(seg_list) + seg_txt.replace('@ ', '@') + if not seg_txt == context.text: + await context.edit(seg_txt) + except: + pass diff --git a/list.json b/list.json index 7a42ac9..bf0c7f1 100644 --- a/list.json +++ b/list.json @@ -526,7 +526,7 @@ "section": "chat", "maintainer": "xtaodada", "size": "4.0 kb", - "supported": true, + "supported": false, "des-short": "打字带空格", "des": "需要 pypi 前置 jieba 。" }