feat✨: add black_word

This commit is contained in:
HibiKier
2024-03-18 16:10:44 +08:00
parent 913811b90d
commit 5dd03bb0ca
14 changed files with 1011 additions and 30 deletions
+13
View File
@@ -6,6 +6,7 @@ from pathlib import Path
from typing import Any
import httpx
import pypinyin
import pytz
from zhenxun.services.log import logger
@@ -151,6 +152,18 @@ class FreqLimiter:
return self.next_time[key] - time.time()
def cn2py(word: str) -> str:
"""将字符串转化为拼音
参数:
word: 文本
"""
temp = ""
for i in pypinyin.pinyin(word, style=pypinyin.NORMAL):
temp += "".join(i)
return temp
async def get_user_avatar(uid: int | str) -> bytes | None:
"""快捷获取用户头像