mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-25 20:38:51 +00:00
kongge 打字带空格
This commit is contained in:
parent
c2c0831d8a
commit
c64228bc94
17
kongge.py
Normal file
17
kongge.py
Normal 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)
|
10
list.json
10
list.json
@ -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 。"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user