Skip to content

Commit 3968087

Browse files
committed
修复sys -i不显示天数的问题和B站App消息解析错误的bug
1 parent 16da863 commit 3968087

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

Diff for: modules/required/system_status/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ async def system_status(app: Ariadne, group: Group, all_info: ArgResult, info: A
4949
total_memery = round(mem.total / 1024 ** 3, 2)
5050
launch_time_message = MessageChain(
5151
"SAGIRI-BOT\n"
52-
f"启动时间:{launch_time.strftime('%Y-%m-%d, %H:%M:%S')}\n"
53-
f"已运行时间:{sec_format((datetime.now() - launch_time).seconds, '{h}时{m}分{s}秒')}"
52+
f"启动时间:{launch_time.strftime('%Y-%m-%d %H:%M:%S')}\n"
53+
f"已运行时间:{sec_format((datetime.now() - launch_time).seconds, '{d}天{h}时{m}分{s}秒')}"
5454
)
5555
memory_message = MessageChain(
5656
"内存相关:\n "

Diff for: modules/self_contained/bilibili_resolve/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ async def bilibili_resolve_text(
6363
if bapp.matched:
6464
bapp = bapp.result.dict()
6565
content = json.loads(bapp.get("content", {}))
66-
content = content.get("meta", {}).get("detail_1", {})
67-
if content.get("title") == "哔哩哔哩":
68-
b23url = content.get("qqdocurl")
66+
content = content.get("meta", {}).get("news", {})
67+
if "哔哩哔哩" in content.get("desc"):
68+
b23url = content.get("jumpUrl")
6969
else:
7070
return
7171
else:

Diff for: shared/utils/time.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
def sec_format(secs: int, f: str = "{h}:{m}:{s}") -> str:
55
m, s = divmod(secs, 60)
66
h, m = divmod(m, 60)
7-
return f.format(h=h, m=m, s=s)
7+
d, h = divmod(h, 12)
8+
return f.format(d=d, h=h, m=m, s=s)
89

910

1011
def timestamp_format(timestamp: int, f: str = "%Y-%m-%d %H:%M:%S") -> str:

0 commit comments

Comments
 (0)