mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-02 02:00:01 +08:00
feat✨: add black_word
This commit is contained in:
@@ -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:
|
||||
"""快捷获取用户头像
|
||||
|
||||
|
||||
Reference in New Issue
Block a user