From 15dfd75ce84235b07b845fdfb42e269002b92c01 Mon Sep 17 00:00:00 2001 From: Kyomotoi <1172294279@qq.com> Date: Mon, 5 Apr 2021 16:01:22 +0800 Subject: =?UTF-8?q?=E2=9C=A8=F0=9F=90=9B=E2=9A=A1=EF=B8=8F=20=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增:转发信息伪造 新增:关键词回复/添加/删除(待更新) 新增:涩图检测(部署方式待更新) 新增:使用方法 新增:ATRI语加密/解密 新增:注入检测 新增:部分命令频率限制 移除:群垃圾检测 优化:提升了部分代码可读性 优化:对 Service 部分代码进行重构 --- ATRI/plugins/utils/__init__.py | 50 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) (limited to 'ATRI/plugins/utils/__init__.py') diff --git a/ATRI/plugins/utils/__init__.py b/ATRI/plugins/utils/__init__.py index 10b3317..b23a01f 100644 --- a/ATRI/plugins/utils/__init__.py +++ b/ATRI/plugins/utils/__init__.py @@ -7,16 +7,25 @@ from ATRI.rule import ( is_in_dormant, is_in_service ) -from .data_source import roll_dice +from .data_source import roll_dice, Encrypt -__plugin_name__ = "roll" +__doc__ = """ +roll一下 +权限组:所有人 +用法: + /roll (int)d(int)+... +补充: + int: 阿拉伯数字 +示例: + /roll 1d10+10d9+4d5+2d3 +""" roll = sv.on_command( - name="roll一下", cmd="/roll", + docs=__doc__, rule=is_block() & is_in_dormant() - & is_in_service(__plugin_name__) + & is_in_service('/roll') ) @roll.handle() @@ -34,3 +43,36 @@ async def _(bot: Bot, event: MessageEvent, state: dict) -> None: await roll.finish("请输入正确的参数!!\ndemo:1d10 或 2d10+2d10") await roll.finish(roll_dice(resu)) + + +__doc__ = """ +加密你的信息! +权限组:所有人 +用法: + /enc e,d msg +补充: + e,d:对应 编码/解码 + msg: 目标内容 +示例: + /enc e アトリは高性能ですから! +""" + +encrypt = sv.on_command( + cmd="/enc", + docs=__doc__, + rule=is_block() & is_in_service('/enc') & is_in_dormant() +) + +@encrypt.handle() +async def _encrypt(bot: Bot, event: MessageEvent) -> None: + msg = str(event.message).split(' ') + _type = msg[0] + s = msg[1] + e = Encrypt() + + if _type == "e": + await encrypt.finish(e.encode(s)) + elif _type == "d": + await encrypt.finish(e.decode(s)) + else: + await encrypt.finish('请检查输入~!') -- cgit v1.2.3