diff options
Diffstat (limited to 'ATRI/plugins/repo.py')
-rw-r--r-- | ATRI/plugins/repo.py | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/ATRI/plugins/repo.py b/ATRI/plugins/repo.py index 40869eb..57fa327 100644 --- a/ATRI/plugins/repo.py +++ b/ATRI/plugins/repo.py @@ -3,16 +3,13 @@ from random import choice from nonebot.matcher import Matcher from nonebot.params import CommandArg, ArgPlainText from nonebot.adapters.onebot.v11 import Bot, MessageEvent, Message +from nonebot.adapters.onebot.v11.helpers import Cooldown from ATRI.service import Service from ATRI.config import BotSelfConfig -from ATRI.utils.limit import FreqLimiter, DailyLimiter -_repo_flmt = FreqLimiter(20) _repo_flmt_notice = choice(["慢...慢一..点❤", "冷静1下", "歇会歇会~~"]) -_repo_dlmt = DailyLimiter(5) -_repo_dlmt_notice = "阿!不能再喝了,再喝就晕过去了!" REPO_FORMAT = """ @@ -29,16 +26,10 @@ class Repo(Service): reporter = Repo().on_command("来杯红茶", "向维护者发送消息", aliases={"反馈", "报告"}) [email protected]([Cooldown(120, prompt=_repo_flmt_notice)]) async def _ready_repo( - matcher: Matcher, event: MessageEvent, args: Message = CommandArg() + matcher: Matcher, args: Message = CommandArg() ): - user_id = event.get_user_id() - if not _repo_flmt.check(user_id): - await reporter.finish(_repo_flmt_notice) - if not _repo_dlmt.check(user_id): - await reporter.finish(_repo_dlmt_notice) - msg = args.extract_plain_text() if msg: matcher.set_arg("repo", args) @@ -59,6 +50,4 @@ async def _deal_repo( except BaseException: await reporter.finish("发送失败了呢...") - _repo_flmt.start_cd(user_id) - _repo_dlmt.increase(user_id) await reporter.finish("吾辈的心愿已由咱转告维护者!") |