summaryrefslogtreecommitdiff
path: root/ATRI/plugins/call-owner.py
diff options
context:
space:
mode:
Diffstat (limited to 'ATRI/plugins/call-owner.py')
-rw-r--r--ATRI/plugins/call-owner.py32
1 files changed, 12 insertions, 20 deletions
diff --git a/ATRI/plugins/call-owner.py b/ATRI/plugins/call-owner.py
index c09276f..af8e83d 100644
--- a/ATRI/plugins/call-owner.py
+++ b/ATRI/plugins/call-owner.py
@@ -1,28 +1,12 @@
-#!/usr/bin/env python3
-# -*- coding:utf-8 -*-
-'''
-File: call-owner.py
-Created Date: 2021-02-19 23:02:45
-Author: Kyomotoi
-License: GPLv3
-Project: https://github.com/Kyomotoi/ATRI
---------
-Last Modified: Sunday, 7th March 2021 3:13:40 pm
-Modified By: Kyomotoi ([email protected])
---------
-Copyright (c) 2021 Kyomotoi
-'''
-
from nonebot.permission import SUPERUSER
-from nonebot.plugin import on_command
from nonebot.typing import T_State
from nonebot.adapters.cqhttp import (
Bot,
MessageEvent
)
-from ATRI.rule import is_in_banlist
+from ATRI.service import Service as sv
+from ATRI.rule import is_block
from ATRI.config import nonebot_config
from ATRI.utils.apscheduler import scheduler
from ATRI.utils.list import count_list
@@ -31,7 +15,11 @@ from ATRI.utils.list import count_list
repo_list = []
-repo = on_command("来杯红茶", rule=is_in_banlist())
+repo = sv.on_command(
+ name="给维护者留言",
+ cmd="来杯红茶",
+ rule=is_block()
+)
@repo.handle()
async def _repo(bot: Bot, event: MessageEvent, state: T_State) -> None:
@@ -69,7 +57,11 @@ async def _() -> None:
repo_list = []
-reset_repo = on_command("重置红茶", permission=SUPERUSER)
+reset_repo = sv.on_command(
+ name="重置给维护者留言次数",
+ cmd="重置红茶",
+ permission=SUPERUSER
+)
@reset_repo.handle()
async def _reset_repo(bot: Bot, event: MessageEvent) -> None: