feat: 对部分消息回复用markdown进行了重新排版

This commit is contained in:
2024-03-20 22:30:52 +08:00
parent 2b8cb2afb6
commit 14d9f041ce
7 changed files with 51 additions and 10 deletions

View File

@ -1,3 +1,6 @@
from urllib.parse import quote
def convert_size(size: int, precision: int = 2, add_unit: bool = True, suffix: str = "iB") -> str:
"""把字节数转换为人类可读的字符串,计算正负
@ -33,12 +36,16 @@ def convert_size(size: int, precision: int = 2, add_unit: bool = True, suffix: s
def de_escape(text: str) -> str:
str_map = {
"[": "[",
"]": "]",
"&": "&",
",": ",",
"[": "[",
"]": "]",
"&": "&",
",": ",",
}
for k, v in str_map.items():
text = text.replace(k, v)
return text
def encode_url(text: str) -> str:
return quote(text, safe="")