mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-25 09:37:30 +00:00
233e7ab58d
Co-authored-by: luoshuijs <luoshuijs@outlook.com> Co-authored-by: Karako <karakohear@gmail.com> Co-authored-by: xtaodada <xtao@xtaolink.cn>
17 lines
618 B
Python
17 lines
618 B
Python
from aiofiles import open as async_open
|
|
from httpx import URL, AsyncClient
|
|
|
|
from utils.const import PROJECT_ROOT
|
|
|
|
GACHA_LOG_PAIMON_MOE_PATH = PROJECT_ROOT.joinpath("metadata/data/paimon_moe_zh.json")
|
|
|
|
|
|
async def update_paimon_moe_zh(overwrite: bool = True):
|
|
if not overwrite and GACHA_LOG_PAIMON_MOE_PATH.exists():
|
|
return
|
|
host = URL("https://raw.fastgit.org/MadeBaruna/paimon-moe/main/src/locales/items/zh.json")
|
|
client = AsyncClient()
|
|
text = (await client.get(host)).text
|
|
async with async_open(GACHA_LOG_PAIMON_MOE_PATH, mode="w", encoding="utf-8") as file:
|
|
await file.write(text)
|