summaryrefslogtreecommitdiff
path: root/ATRI/plugins/call-owner.py
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2021-04-15 14:15:25 +0800
committerKyomotoi <[email protected]>2021-04-15 14:15:25 +0800
commit2349350ba8db8a572a49e931891eaa42a4207df4 (patch)
treea86a71fd374d54d7fded9ac52d16b3670d0e6a81 /ATRI/plugins/call-owner.py
parentd03636606de4c2f8c5c163f0e797325c7d182346 (diff)
downloadATRI-2349350ba8db8a572a49e931891eaa42a4207df4.tar.gz
ATRI-2349350ba8db8a572a49e931891eaa42a4207df4.tar.bz2
ATRI-2349350ba8db8a572a49e931891eaa42a4207df4.zip
✨🐛⚡️ 一些改动
新增:以图搜图 挖坑:今天吃什么 修复:只响应私聊消息 修复:nsfw部分变量错误 优化:插件名 优化:部分插件代码结构
Diffstat (limited to 'ATRI/plugins/call-owner.py')
-rw-r--r--ATRI/plugins/call-owner.py88
1 files changed, 0 insertions, 88 deletions
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__)
-
[email protected]_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
-
-async def _repo(bot: Bot, event: MessageEvent, state: T_State) -> None:
- msg = str(event.message).strip()
- if msg:
- state["msg"] = msg
-
[email protected]("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("吾辈的心愿已由咱转告给咱的维护者了~!")
-
-
- "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("红茶重置完成~!")