From 2349350ba8db8a572a49e931891eaa42a4207df4 Mon Sep 17 00:00:00 2001 From: Kyomotoi <1172294279@qq.com> Date: Thu, 15 Apr 2021 14:15:25 +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=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增:以图搜图 挖坑:今天吃什么 修复:只响应私聊消息 修复:nsfw部分变量错误 优化:插件名 优化:部分插件代码结构 --- ATRI/plugins/call-owner.py | 88 ---------------------------------------------- 1 file changed, 88 deletions(-) delete mode 100644 ATRI/plugins/call-owner.py (limited to 'ATRI/plugins/call-owner.py') diff --git a/ATRI/plugins/call-owner.py b/ATRI/plugins/call-owner.py deleted file mode 100644 index 5384fdd..0000000 --- a/ATRI/plugins/call-owner.py +++ /dev/null @@ -1,88 +0,0 @@ -from nonebot.permission import SUPERUSER -from nonebot.typing import T_State -from nonebot.adapters.cqhttp import ( - Bot, - MessageEvent -) - -from ATRI.service import Service as sv -from ATRI.config import Config -from ATRI.utils.apscheduler import scheduler -from ATRI.utils.list import count_list - - -repo_list = [] -__doc__ = """ -给维护者留言 -权限组:所有人 -用法: - /来杯红茶 (msg) -""" - -repo = sv.on_command(cmd="来杯红茶", docs=__doc__) - -@repo.args_parser # type: ignore -async def _nsfw(bot: Bot, event: MessageEvent, state: T_State) -> None: - msg = str(event.message) - if msg == "算了": - await repo.finish('好吧') - - if not msg: - await repo.reject('话呢?') - else: - state['pic'] = msg - -@repo.handle() -async def _repo(bot: Bot, event: MessageEvent, state: T_State) -> None: - msg = str(event.message).strip() - if msg: - state["msg"] = msg - -@repo.got("msg", prompt="请告诉咱需要反馈的内容~!") -async def _repo_(bot: Bot, event: MessageEvent, state: T_State) -> None: - global repo_list - msg = state["msg"] - user = event.user_id - - if count_list(repo_list, user) == 5: - await repo.finish("吾辈已经喝了五杯红茶啦!明天再来吧。") - - repo_list.append(user) - - for sup in Config.BotSelfConfig.superusers: - await bot.send_private_msg( - user_id=sup, - message=f"来自用户[{user}]反馈:\n{msg}" - ) - - await repo.finish("吾辈的心愿已由咱转告给咱的维护者了~!") - - -@scheduler.scheduled_job( - "cron", - hour=0, - misfire_grace_time=60 -) -async def _() -> None: - global repo_list - repo_list.clear() - - -__doc__ = """ -重置给维护者的留言次数 -权限组:维护者 -用法: - /重置红茶 -""" - -reset_repo = sv.on_command( - cmd="重置红茶", - docs=__doc__, - permission=SUPERUSER -) - -@reset_repo.handle() -async def _reset_repo(bot: Bot, event: MessageEvent) -> None: - global repo_list - repo_list.clear() - await reset_repo.finish("红茶重置完成~!") -- cgit v1.2.3