Cesloi

Latest version: v0.6.11

Safety actively analyzes 638741 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 5

0.3.3

增加文本匹配后的参数替换功能,在SubscriberHandler里设置。
该功能会在事件提供的messageChain参数通过了sh设置的Command解析器并且该Command内含有提取文本的正则的情况下,将匹配出来的内容根据设定的参数来决定是否替换掉原来的messageChain的内容(注意,Source元素不会被替换掉)
例子:
python
ed.register("FriendMessage")
sh.set(command=Command(["cmd.", "bot"], [f"{AnyStr}天气", ["=", AnyStr, ""], ""]),
require_param_name="city",
is_replace_message=True)
async def test1(city: MessageChain):
print(city.to_text())

则Command匹配成功的情况下会把event原先传给city的messageChain的内容替换AnyStr匹配得到的结果
如果 `is_replace_message`为False,则event的messageChain保持不变
另外:
- 修复At元素不能发出的bug

0.3.2

增加了插件系统
这个玩意还在初期阶段,等待后续跟进
顺便把logger换成了loguru

0.3.1

完善了mah v2给出的通用接口
更改了部分内容
- friend、group类的在model.relation里
- fileinfo类的在model.utils里

0.2.4

新增命令/命令参数解析器,替代原来的command_headers之类的

0.2.2

给消息链新增加了一些方法,比如has与pop

0.2.1

Cesloi现在可以正常使用了

Page 4 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.