From 62f339d431811c5908a7e5f2eaabd6d45ca1be84 Mon Sep 17 00:00:00 2001 From: Kyomotoi <0w0@imki.moe> Date: Thu, 13 Oct 2022 16:22:02 +0800 Subject: =?UTF-8?q?=F0=9F=8E=A8=E2=9A=A1=EF=B8=8F=20=E8=B7=9F=E8=BF=9B=20c?= =?UTF-8?q?onfig=20=E9=A1=B9=E7=9A=84=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ATRI/plugins/essential.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'ATRI/plugins/essential.py') diff --git a/ATRI/plugins/essential.py b/ATRI/plugins/essential.py index d40856d..c9b48a7 100644 --- a/ATRI/plugins/essential.py +++ b/ATRI/plugins/essential.py @@ -27,11 +27,9 @@ from nonebot.adapters.onebot.v11 import ( Message, ) - +from ATRI import conf from ATRI.service import Service from ATRI.log import log -from ATRI.config import BotSelfConfig - from ATRI.utils import MessageChecker from ATRI.utils.apscheduler import scheduler @@ -142,7 +140,7 @@ async def _friend_add(bot: Bot, event: FriendRequestEvent): f"申请码:{apply_code}\n" "Tip: 获取好友申请" ) - for superuser in BotSelfConfig.superusers: + for superuser in conf.BotConfig.superusers: await bot.send_private_msg(user_id=superuser, message=repo) @@ -188,7 +186,7 @@ async def _group_invite(bot: Bot, event: GroupRequestEvent): f"申请码:{apply_code}\n" "Tip: 获取邀请列表" ) - for superuser in BotSelfConfig.superusers: + for superuser in conf.BotConfig.superusers: await bot.send_private_msg(user_id=superuser, message=repo) @@ -198,7 +196,7 @@ group_member_event = Essential().on_notice("群成员变动", "群成员变动 @group_member_event.handle() async def _group_member_join(bot: Bot, event: GroupIncreaseNoticeEvent): await asyncio.sleep(randint(1, 6)) - msg = "好欸!事新人!\n" f"在下 {choice(list(BotSelfConfig.nickname))} 哒!w!" + msg = "好欸!事新人!\n" f"在下 {choice(list(conf.BotConfig.nickname))} 哒!w!" await group_member_event.finish(msg) @@ -216,7 +214,7 @@ async def _group_admin_event(bot: Bot, event: GroupAdminNoticeEvent): if not event.is_tome(): return - for superuser in BotSelfConfig.superusers: + for superuser in conf.BotConfig.superusers: await bot.send_private_msg( user_id=int(superuser), message=f"好欸!主人!我在群 {event.group_id} 成为了管理!!" ) @@ -236,11 +234,11 @@ async def _group_ban_event(bot: Bot, event: GroupBanNoticeEvent): f"咱在群 {event.group_id} 被 {event.operator_id} 塞上了口球...\n" f"时长...是 {event.duration} 秒" ) - for superuser in BotSelfConfig.superusers: + for superuser in conf.BotConfig.superusers: await bot.send_private_msg(user_id=int(superuser), message=msg) else: msg = "好欸!主人\n" f"咱在群 {event.group_id} 的口球被 {event.operator_id} 解除了!" - for superuser in BotSelfConfig.superusers: + for superuser in conf.BotConfig.superusers: await bot.send_private_msg(user_id=int(superuser), message=msg) @@ -277,7 +275,7 @@ async def _recall_group_event(bot: Bot, event: GroupRecallNoticeEvent): else: return msg = f"主人,咱拿到了一条撤回信息!\n{user}@[群:{group}]\n撤回了\n{m}" - for superuser in BotSelfConfig.superusers: + for superuser in conf.BotConfig.superusers: await bot.send_private_msg(user_id=int(superuser), message=Message(msg)) @@ -308,7 +306,7 @@ async def _recall_private_event(bot: Bot, event: FriendRecallNoticeEvent): return msg = f"主人,咱拿到了一条撤回信息!\n{user}@[私聊]撤回了\n{m}" - for superuser in BotSelfConfig.superusers: + for superuser in conf.BotConfig.superusers: await bot.send_private_msg(user_id=int(superuser), message=Message(msg)) -- cgit v1.2.3