diff options
author | Kyomotoi <[email protected]> | 2021-02-06 00:32:26 +0800 |
---|---|---|
committer | Kyomotoi <[email protected]> | 2021-02-06 00:32:26 +0800 |
commit | f5ceb8927f2e7f2a9e29d62c8e4cef876f917249 (patch) | |
tree | 40b9dcd6b7d3db486054e3aa9b5a04d25fa2284e /ATRI/plugins/utils/__init__.py | |
parent | eb52fab79ada7efe6191e3a5f90179766feaded0 (diff) | |
download | ATRI-f5ceb8927f2e7f2a9e29d62c8e4cef876f917249.tar.gz ATRI-f5ceb8927f2e7f2a9e29d62c8e4cef876f917249.tar.bz2 ATRI-f5ceb8927f2e7f2a9e29d62c8e4cef876f917249.zip |
🏗 💩 更改项目结构,修复啥b BUG
Diffstat (limited to 'ATRI/plugins/utils/__init__.py')
-rw-r--r-- | ATRI/plugins/utils/__init__.py | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/ATRI/plugins/utils/__init__.py b/ATRI/plugins/utils/__init__.py index 4204cfb..e69de29 100644 --- a/ATRI/plugins/utils/__init__.py +++ b/ATRI/plugins/utils/__init__.py @@ -1,76 +0,0 @@ -import re -from nonebot.matcher import Matcher -from nonebot.plugin import on_command -from nonebot.adapters.cqhttp import Bot, Event - -from ATRI.config import UTILS_CONFIG -from ATRI.rule import is_in_ban_list, is_in_dormant, is_in_service - -from .data_source import Function - -# ===========================[Begin Command Processing]=========================== - - -__plugin_name_0__ = 'roll' -roll = on_command(UTILS_CONFIG['utils']['roll']['command'][0], - aliases=set(UTILS_CONFIG['utils']['roll']['command']), - rule=is_in_ban_list() & is_in_dormant() - & is_in_service(__plugin_name_0__)) - -__plugin_name_1__ = 'rcnb' -rcnbEncode = on_command( - UTILS_CONFIG['utils']['rcnb']['encode']['command'][0], - aliases=set( - UTILS_CONFIG['utils']['rcnb']['encode']['command']), - rule=is_in_ban_list() & is_in_dormant() - & is_in_service(__plugin_name_1__)) - -rcnbDecode = on_command( - UTILS_CONFIG['utils']['rcnb']['decode']['command'][0], - aliases=set( - UTILS_CONFIG['utils']['rcnb']['decode']['command']), - rule=is_in_ban_list() & is_in_dormant() - & is_in_service(__plugin_name_1__)) - - -async def _(bot, event: Event, state: dict) -> None: - args = str(event.get_message()).strip() - print(args) - if args: - state['result'] = args - [email protected]('result', prompt='roll参数不能为空!..\ndemo: 1d10 或 2d10+3d10') -async def _(matcher: Matcher, bot: Bot, event: Event, state: dict) -> None: - resu = state['result'] - match = re.match(r'^([\dd+\s]+?)$', resu) - print(match) - if not match: - await matcher.reject('格式不-正-确!\ndemo: 1d10 或 2d10+3d10') - await bot.send(event, Function.roll_dice(par=resu)) - - -async def _(bot, event: Event, state: dict) -> None: - args = str(event.get_message()).strip() - if args: - state['result'] = args - [email protected]('result', prompt='请告诉咱需要加密的字符~!') -async def _(bot: Bot, event: Event, state: dict) -> None: - print(state['result']) - await bot.send(event, Function.RCNB.encode(state['result'])) - - -async def _(bot, event: Event, state: dict) -> None: - args = str(event.get_message()).strip() - if args: - state['result'] = args - [email protected]('result', prompt='请告诉咱需要解密的字符~!') -async def _(bot: Bot, event: Event, state: dict) -> None: - await bot.send(event, Function.RCNB.decode(state['result'])) - - -# ===========================[End Command Processing]============================= |