From 64a991e035e52e0a17e73d4e671a22ea9a7489da Mon Sep 17 00:00:00 2001 From: Kyomotoi <1172294279@qq.com> Date: Sun, 14 Mar 2021 16:22:34 +0800 Subject: =?UTF-8?q?=E2=9C=A8=F0=9F=90=9B=20=E6=9B=B4=E6=96=B0=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ATRI/plugins/utils/__init__.py | 43 ++++++------------------------------------ 1 file changed, 6 insertions(+), 37 deletions(-) (limited to 'ATRI/plugins/utils/__init__.py') diff --git a/ATRI/plugins/utils/__init__.py b/ATRI/plugins/utils/__init__.py index 47c3b47..10b3317 100644 --- a/ATRI/plugins/utils/__init__.py +++ b/ATRI/plugins/utils/__init__.py @@ -1,26 +1,9 @@ -#!/usr/bin/env python3 -# -*- coding:utf-8 -*- -''' -File: __init__.py -Created Date: 2021-02-04 21:14:48 -Author: Kyomotoi -Email: Kyomotoiowo@gmail.com -License: GPLv3 -Project: https://github.com/Kyomotoi/ATRI --------- -Last Modified: Sunday, 7th March 2021 3:14:16 pm -Modified By: Kyomotoi (kyomotoiowo@gmail.com) --------- -Copyright (c) 2021 Kyomotoi -''' - import re - -from nonebot.plugin import on_command from nonebot.adapters.cqhttp import Bot, MessageEvent +from ATRI.service import Service as sv from ATRI.rule import ( - is_in_banlist, + is_block, is_in_dormant, is_in_service ) @@ -29,9 +12,10 @@ from .data_source import roll_dice __plugin_name__ = "roll" -roll = on_command( - "/roll", - rule=is_in_banlist() & is_in_dormant() +roll = sv.on_command( + name="roll一下", + cmd="/roll", + rule=is_block() & is_in_dormant() & is_in_service(__plugin_name__) ) @@ -50,18 +34,3 @@ async def _(bot: Bot, event: MessageEvent, state: dict) -> None: await roll.finish("请输入正确的参数!!\ndemo:1d10 或 2d10+2d10") await roll.finish(roll_dice(resu)) - - -# __plugin_name__ = "fakemsg" - -# fakemsg = on_command( -# "/fakemsg", -# rule=is_in_banlist() & is_in_dormant() -# & is_in_service(__plugin_name__) -# ) - -# @fakemsg.handle() -# async def _fakemsg(bot: Bot, event: MessageEvent, state: dict) -> None: -# ... - -# @fakemsg.got() \ No newline at end of file -- cgit v1.2.3