ruff归零

This commit is contained in:
明天好像没什么
2025-11-01 21:32:41 +08:00
parent ce9727bdb0
commit 30658afdb4
20 changed files with 106 additions and 48 deletions

View File

@@ -7,6 +7,7 @@ import time
import uuid
from typing import Any
import aiofiles
import numpy as np
from PIL import Image
from rich.traceback import install
@@ -198,8 +199,8 @@ class ImageManager:
os.makedirs(emoji_dir, exist_ok=True)
file_path = os.path.join(emoji_dir, filename)
with open(file_path, "wb") as f:
f.write(image_bytes)
async with aiofiles.open(file_path, "wb") as f:
await f.write(image_bytes)
logger.info(f"新表情包已保存至待注册目录: {file_path}")
except Exception as e:
logger.error(f"保存待注册表情包文件失败: {e!s}")
@@ -436,8 +437,8 @@ class ImageManager:
os.makedirs(image_dir, exist_ok=True)
file_path = os.path.join(image_dir, filename)
with open(file_path, "wb") as f:
f.write(image_bytes)
async with aiofiles.open(file_path, "wb") as f:
await f.write(image_bytes)
new_img = Images(
image_id=image_id,