summaryrefslogtreecommitdiff
path: root/ATRI/plugins/call_owner.py
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2021-07-08 22:09:00 +0800
committerKyomotoi <[email protected]>2021-07-08 22:09:00 +0800
commitbe2747e4d4b820ca0f1f988d3b77a628da26fe7b (patch)
treee1a59dd79ecd973a7d704568dcdc018f1f1b651a /ATRI/plugins/call_owner.py
parenta4e1b9d1581d756ef79ad063d1c0bd6b2fd13c1d (diff)
downloadATRI-be2747e4d4b820ca0f1f988d3b77a628da26fe7b.tar.gz
ATRI-be2747e4d4b820ca0f1f988d3b77a628da26fe7b.tar.bz2
ATRI-be2747e4d4b820ca0f1f988d3b77a628da26fe7b.zip
🔖♻️🐛🔧🔥📝 更新版本:YHN-001-A03
🔖 更新版本至:YHN-001-A03 ✨ 新增插件: - 涩图 - 闲聊(文爱 ♻️ 重构: - Service - 所有插件 🐛 修复部分小bug 🔧 暂时移除部分设置 🔥 删除: - 插件:nsfw、wife。日后加回 - 插件 essential 中部分内容 📝 更新README
Diffstat (limited to 'ATRI/plugins/call_owner.py')
-rw-r--r--ATRI/plugins/call_owner.py78
1 files changed, 0 insertions, 78 deletions
diff --git a/ATRI/plugins/call_owner.py b/ATRI/plugins/call_owner.py
deleted file mode 100644
index bcbae73..0000000
--- a/ATRI/plugins/call_owner.py
+++ /dev/null
@@ -1,78 +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 BotSelfConfig
-from ATRI.utils.apscheduler import scheduler
-from ATRI.utils.list import count_list
-
-
-repo_list = []
-__doc__ = """
-给维护者留言
-权限组:所有人
-用法:
- 来杯红茶 (msg)
-"""
-
-repo = sv.on_command(cmd="来杯红茶", docs=__doc__)
-
-
[email protected]_parser # type: ignore
-async def _repo_load(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["msg_repo"] = msg
-
-
-async def _repo(bot: Bot, event: MessageEvent, state: T_State) -> None:
- msg = str(event.message).strip()
- if msg:
- state["msg_repo"] = msg
-
-
[email protected]("msg_repo", prompt="请告诉咱需要反馈的内容~!")
-async def _repo_deal(bot: Bot, event: MessageEvent, state: T_State) -> None:
- global repo_list
- msg = state["msg_repo"]
- user = event.user_id
-
- if count_list(repo_list, user) == 5:
- await repo.finish("吾辈已经喝了五杯红茶啦!明天再来吧。")
-
- repo_list.append(user)
-
- for sup in BotSelfConfig.superusers:
- await bot.send_private_msg(user_id=sup, message=f"来自用户[{user}]反馈:\n{msg}")
-
- await repo.finish("吾辈的心愿已由咱转告给咱的维护者了~!")
-
-
[email protected]_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("红茶重置完成~!")