diff options
Diffstat (limited to 'ATRI/plugins')
-rw-r--r-- | ATRI/plugins/chat/__init__.py | 4 | ||||
-rw-r--r-- | ATRI/plugins/essential.py | 13 | ||||
-rw-r--r-- | ATRI/plugins/help/__init__.py | 6 | ||||
-rw-r--r-- | ATRI/plugins/help/data_source.py | 6 | ||||
-rw-r--r-- | ATRI/plugins/rich/__init__.py | 4 | ||||
-rw-r--r-- | ATRI/plugins/setu/__init__.py | 2 | ||||
-rw-r--r-- | ATRI/plugins/wife/__init__.py | 6 |
7 files changed, 22 insertions, 19 deletions
diff --git a/ATRI/plugins/chat/__init__.py b/ATRI/plugins/chat/__init__.py index 723ee25..f401f3f 100644 --- a/ATRI/plugins/chat/__init__.py +++ b/ATRI/plugins/chat/__init__.py @@ -12,7 +12,7 @@ _chat_flmt = FreqLimiter(3) _chat_flmt_notice = choice(["慢...慢一..点❤", "冷静1下", "歇会歇会~~", "我开始为你以后的伴侣担心了..."]) -chat = Chat().on_message("闲聊(文爱") +chat = Chat().on_message("文爱", "闲聊(文爱") @chat.handle() @@ -31,7 +31,7 @@ async def _chat(bot: Bot, event: MessageEvent): return -my_name_is = Chat().on_command("叫我", "更改闲聊(划掉 文爱)时的称呼", aliases={"我是"}, priority=1) +my_name_is = Chat().on_command("叫我", "更改闲聊(文爱)时的称呼", aliases={"我是"}, priority=1) @my_name_is.args_parser # type: ignore diff --git a/ATRI/plugins/essential.py b/ATRI/plugins/essential.py index 09107d5..fb493a9 100644 --- a/ATRI/plugins/essential.py +++ b/ATRI/plugins/essential.py @@ -48,6 +48,7 @@ os.makedirs(TEMP_PATH, exist_ok=True) @driver.on_startup async def startup(): + log.info(f"Now running: {ATRI.__version__}") log.info("アトリは、高性能ですから!") @@ -116,7 +117,7 @@ class Essential(Service): Service.__init__(self, "基础部件", __doc__) -friend_add_event = Essential().on_request("好友添加") +friend_add_event = Essential().on_request("好友添加", "好友添加检测") @friend_add_event.handle() @@ -162,7 +163,7 @@ async def _friend_add(bot: Bot, event: FriendRequestEvent): await bot.send_private_msg(user_id=superuser, message=repo) -group_invite_event = Essential().on_request("邀请入群") +group_invite_event = Essential().on_request("邀请入群", "被邀请入群检测") @group_invite_event.handle() @@ -208,7 +209,7 @@ async def _group_invite(bot: Bot, event: GroupRequestEvent): await bot.send_private_msg(user_id=superuser, message=repo) -group_member_event = Essential().on_notice("群成员变动") +group_member_event = Essential().on_notice("群成员变动", "群成员变动检测") @group_member_event.handle() @@ -224,7 +225,7 @@ async def _group_member_left(bot: Bot, event: GroupDecreaseNoticeEvent): await group_member_event.finish("呜——有人跑了...") -group_admin_event = Essential().on_notice("群管理变动") +group_admin_event = Essential().on_notice("群管理变动", "群管理变动检测") @group_admin_event.handle() @@ -238,7 +239,7 @@ async def _group_admin_event(bot: Bot, event: GroupAdminNoticeEvent): ) -group_ban_event = Essential().on_notice("群禁言变动") +group_ban_event = Essential().on_notice("群禁言变动", "群禁言变动检测") @group_ban_event.handle() @@ -260,7 +261,7 @@ async def _group_ban_event(bot: Bot, event: GroupBanNoticeEvent): await bot.send_private_msg(user_id=int(superuser), message=msg) -recall_event = Essential().on_notice("撤回事件") +recall_event = Essential().on_notice("撤回事件", "撤回事件检测") @recall_event.handle() diff --git a/ATRI/plugins/help/__init__.py b/ATRI/plugins/help/__init__.py index 339ffa2..1d1102e 100644 --- a/ATRI/plugins/help/__init__.py +++ b/ATRI/plugins/help/__init__.py @@ -5,9 +5,7 @@ from ATRI.rule import to_bot from .data_source import Helper -main_help = Helper().on_command( - "菜单", "获取食用bot的方法", rule=to_bot(), aliases={"/help", "menu"} -) +main_help = Helper().on_command("菜单", "获取食用bot的方法", rule=to_bot(), aliases={"menu"}) @main_help.handle() @@ -34,7 +32,7 @@ async def _service_list(bot: Bot, event: MessageEvent): await service_list.finish(repo) -service_info = Helper().on_command("帮助", "获取服务详细帮助", rule=to_bot()) +service_info = Helper().on_command("帮助", "获取服务详细帮助", aliases={"help"}, rule=to_bot()) @service_info.handle() diff --git a/ATRI/plugins/help/data_source.py b/ATRI/plugins/help/data_source.py index 638bee2..7b2f6f8 100644 --- a/ATRI/plugins/help/data_source.py +++ b/ATRI/plugins/help/data_source.py @@ -9,7 +9,7 @@ from ATRI.exceptions import ReadFileError SERVICE_INFO_FORMAT = """ 服务名:{service} 说明:{docs} -可用命令:\n{cmd_list} +可用命令:\n {cmd_list} 是否全局启用:{enabled} Tip: 帮助 [服务] [命令] 以查看对应命令详细信息 """.strip() @@ -60,7 +60,7 @@ class Helper(Service): temp_list.append(service) msg0 = "咱搭载了以下服务~\n" - services = " | ".join(map(str, temp_list)) + services = "、".join(map(str, temp_list)) msg0 = msg0 + services repo = msg0 + "\n@ 帮助 [服务] -以查看对应服务帮助" return repo @@ -77,7 +77,7 @@ class Helper(Service): service_enabled = data.get("enabled", True) _service_cmd_list = list(data.get("cmd_list", {"error"})) - service_cmd_list = "\n".join(map(str, _service_cmd_list)) + service_cmd_list = "、".join(map(str, _service_cmd_list)) repo = SERVICE_INFO_FORMAT.format( service=service_name, diff --git a/ATRI/plugins/rich/__init__.py b/ATRI/plugins/rich/__init__.py index b18ae51..bcd58f7 100644 --- a/ATRI/plugins/rich/__init__.py +++ b/ATRI/plugins/rich/__init__.py @@ -6,7 +6,7 @@ from .data_source import Rich _rich_flmt = FreqLimiter(3) -bili_rich = Rich().on_message("小程序爪巴", block=False) +bili_rich = Rich().on_message("小程序检测", "小程序爪巴", block=False) @bili_rich.handle() @@ -18,7 +18,7 @@ async def _fk_bili(bot: Bot, event: MessageEvent): msg = str(event.message) try: result, is_ok = await Rich().fk_bili(msg) - except BaseException: + except Exception: return log.debug(result, is_ok) if not is_ok: diff --git a/ATRI/plugins/setu/__init__.py b/ATRI/plugins/setu/__init__.py index d252416..244e030 100644 --- a/ATRI/plugins/setu/__init__.py +++ b/ATRI/plugins/setu/__init__.py @@ -81,7 +81,7 @@ async def _tag_setu(bot: Bot, event: MessageEvent): _catcher_max_file_size = 128 -setu_catcher = Setu().on_message("涩图嗅探", block=False) +setu_catcher = Setu().on_message("涩图嗅探", "涩图嗅探器", block=False) @setu_catcher.handle() diff --git a/ATRI/plugins/wife/__init__.py b/ATRI/plugins/wife/__init__.py index 493c9ca..57a5af2 100644 --- a/ATRI/plugins/wife/__init__.py +++ b/ATRI/plugins/wife/__init__.py @@ -16,7 +16,11 @@ _is_tietie = True tietie_superuser = Wife().on_message( - "只与维护者贴贴w,‘不可以贴’以拒绝贴贴~,‘来贴贴’以接受贴贴~", rule=Rule(), permission=SUPERUSER, block=False + "贴贴", + "只与维护者贴贴w,‘不可以贴’以拒绝贴贴~,‘来贴贴’以接受贴贴~", + rule=Rule(), + permission=SUPERUSER, + block=False, ) |