summaryrefslogtreecommitdiff
path: root/ATRI/plugins/plugin_utils/__init__.py
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2020-12-06 16:45:38 +0800
committerKyomotoi <[email protected]>2020-12-06 16:45:38 +0800
commitdc4fd407386522bca6bae22933ac1c6f17d1f16d (patch)
tree916c9c95be9e1719ab67296b40eb297b703e7f2e /ATRI/plugins/plugin_utils/__init__.py
parent50c41b629532eae599320517387b4b56f6d16ff6 (diff)
downloadATRI-dc4fd407386522bca6bae22933ac1c6f17d1f16d.tar.gz
ATRI-dc4fd407386522bca6bae22933ac1c6f17d1f16d.tar.bz2
ATRI-dc4fd407386522bca6bae22933ac1c6f17d1f16d.zip
[Update]
Diffstat (limited to 'ATRI/plugins/plugin_utils/__init__.py')
-rw-r--r--ATRI/plugins/plugin_utils/__init__.py42
1 files changed, 41 insertions, 1 deletions
diff --git a/ATRI/plugins/plugin_utils/__init__.py b/ATRI/plugins/plugin_utils/__init__.py
index 11f6c8b..4181e30 100644
--- a/ATRI/plugins/plugin_utils/__init__.py
+++ b/ATRI/plugins/plugin_utils/__init__.py
@@ -20,7 +20,7 @@ from nonebot.typing import Bot, Event
from ATRI.utils.utils_error import errorRepo
from ATRI.utils.utils_rule import check_banlist, check_switch
-from .data_source import Generate, Genshin, Roll
+from .data_source import Generate, Genshin, Roll, RCNB
plugin_name_0 = "one-key-adult"
generateID = on_command("我要转大人,一天打25小时游戏",
@@ -114,3 +114,43 @@ async def _(bot: Bot, event: Event, state: dict) -> None:
else:
await genshinInfo.finish('UID检查未通过,请确保此ID为9位数或者是否为国服ID~!')
+
+
+rcnb = RCNB()
+
+rcnbEncode = on_command('RC一下',
+ aliases={'rc一下', '啊西一下', '阿西一下'},
+ rule=check_banlist())
+
+
+async def _(bot: Bot, event: Event, state: dict) -> None:
+ msg = str(event.message).strip()
+
+ if msg:
+ state['msg'] = msg
+
+
[email protected]('msg', prompt='请告诉咱需要RC一下的字符~!')
+async def _(bot: Bot, event: Event, state: dict) -> None:
+ msg = state['msg']
+ await rcnbEncode.finish(rcnb._encode(msg))
+
+
+rcnbDecode = on_command('一下RC',
+ aliases={'一下rc', '一下啊西', '一下阿西'},
+ rule=check_banlist())
+
+
+async def _(bot: Bot, event: Event, state: dict) -> None:
+ msg = str(event.message).strip()
+
+ if msg:
+ state['msg'] = msg
+
+
[email protected]('msg', prompt='请告诉咱需要一下RC的字符~!')
+async def _(bot: Bot, event: Event, state: dict) -> None:
+ msg = state['msg']
+ await rcnbDecode.finish(rcnb._decode(msg))