kongge 打字带空格

This commit is contained in:
xtaodada 2021-06-28 13:32:46 +08:00
parent c2c0831d8a
commit c64228bc94
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
2 changed files with 27 additions and 0 deletions

17
kongge.py Normal file
View File

@ -0,0 +1,17 @@
from pagermaid.listener import listener
jieba_imported = True
try:
import jieba
except ImportError:
jieba_imported = False
@listener(is_plugin=True, outgoing=True, ignore_edited=True)
async def kongge(context):
if jieba_imported and context.text:
seg_list = jieba.cut(context.text)
seg_txt = ' '.join(seg_list)
if not seg_txt == context.text:
await context.edit(seg_txt)

View File

@ -519,6 +519,16 @@
"supported": true, "supported": true,
"des-short": "将聊天内容生成为词云", "des-short": "将聊天内容生成为词云",
"des": "拉取最新 300 条消息生成一张词云图片。\n\n命令-groupword" "des": "拉取最新 300 条消息生成一张词云图片。\n\n命令-groupword"
},
{
"name": "kongge",
"version": "1.0",
"section": "chat",
"maintainer": "xtaodada",
"size": "4.0 kb",
"supported": true,
"des-short": "打字带空格",
"des": "需要 pypi 前置 jieba 。"
} }
] ]
} }