diff options
author | Kyomotoi <[email protected]> | 2020-08-04 23:58:43 +0800 |
---|---|---|
committer | Kyomotoi <[email protected]> | 2020-08-04 23:58:43 +0800 |
commit | 133616655fd7bf39f0eea422b5057612cb3cccaa (patch) | |
tree | ab8bfa229574aedac89f37a825cd06ca5a2a9b80 /ATRI/plugins/setu.py | |
parent | 2607d289de37e535b6599532df4d2c41fc0b2358 (diff) | |
download | ATRI-133616655fd7bf39f0eea422b5057612cb3cccaa.tar.gz ATRI-133616655fd7bf39f0eea422b5057612cb3cccaa.tar.bz2 ATRI-133616655fd7bf39f0eea422b5057612cb3cccaa.zip |
[Fix] 修复数据库上传问题
Diffstat (limited to 'ATRI/plugins/setu.py')
-rw-r--r-- | ATRI/plugins/setu.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/ATRI/plugins/setu.py b/ATRI/plugins/setu.py index 315803b..b178fef 100644 --- a/ATRI/plugins/setu.py +++ b/ATRI/plugins/setu.py @@ -3,6 +3,9 @@ import time import json import nonebot from nonebot import on_command, CommandSession +from nonebot import NLPSession +from nonebot.natural_language import NLPResult +from nonebot.plugin import on_natural_language from ATRI.modules import response # type: ignore @@ -15,17 +18,18 @@ URL = 'https://api.lolicon.app/setu/' SETU_REPLY = """Title: {title} Pid: {pid} -[CQ:image,file={setu}] +{setu} --------------- 完成时间:{time}s""" -@on_command('setu', aliases = ['图来'], only_to_me = False) -async def _(session: CommandSession): - with open(f'ATRI\\plugins\\switch\\switch.json', 'r') as f: +@on_command('setu', aliases = ['图来', '涩图', '涩图来'], only_to_me = False) +async def setu(session: CommandSession): + with open('ATRI/plugins/switch/switch.json', 'r') as f: data = json.load(f) if data["setu"] == 0: + await session.send('别急!正在找图!') start = time.perf_counter() values = { "apikey": apikey, @@ -46,4 +50,8 @@ async def _(session: CommandSession): ) else: - await session.send('该功能已被禁用...')
\ No newline at end of file + await session.send('该功能已被禁用...') + +@on_natural_language(['涩图', '色图'], only_to_me = False) +async def _(session: NLPSession): + return NLPResult(60.0, ('setu'), None)
\ No newline at end of file |