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/hbook.py | |
parent | 2607d289de37e535b6599532df4d2c41fc0b2358 (diff) | |
download | ATRI-133616655fd7bf39f0eea422b5057612cb3cccaa.tar.gz ATRI-133616655fd7bf39f0eea422b5057612cb3cccaa.tar.bz2 ATRI-133616655fd7bf39f0eea422b5057612cb3cccaa.zip |
[Fix] 修复数据库上传问题
Diffstat (limited to 'ATRI/plugins/hbook.py')
-rw-r--r-- | ATRI/plugins/hbook.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ATRI/plugins/hbook.py b/ATRI/plugins/hbook.py index b0733f8..d1a79bc 100644 --- a/ATRI/plugins/hbook.py +++ b/ATRI/plugins/hbook.py @@ -1,5 +1,6 @@ # -*- coding:utf-8 -*- import re +import time import json from nonebot import on_command, CommandSession @@ -8,10 +9,11 @@ from ATRI.modules import response # type: ignore @on_command('hbook', aliases = ['本子', '本子搜索', '本子查询'], only_to_me = False) async def _(session: CommandSession): - with open(f'ATRI\\plugins\\switch\\switch.json', 'r') as f: + with open('ATRI/plugins/switch/switch.json', 'r') as f: data = json.load(f) if data["hbook"] == 0: + start = time.perf_counter() h_msg = session.current_arg.strip() if not h_msg: @@ -50,6 +52,10 @@ async def _(session: CommandSession): for i in range(n): msg0 = ('\n——————————\n本子链接:https://b-upp.com%s \n本子标题:%s '%(data[i])) msg += msg0 + end = time.perf_counter() + msg0 = f'\n——————————\n耗时: {round(end - start, 3)}s' + msg += msg0 + await session.send(message=msg) else: |