style: 格式化代码

This commit is contained in:
John Richard
2025-10-02 19:38:39 +08:00
committed by Windpicker-owo
parent e7aaafde2f
commit 00ba07e0e1
111 changed files with 2343 additions and 2316 deletions

View File

@@ -3,7 +3,6 @@
表情包发送历史记录模块
"""
import os
from typing import List, Dict
from collections import deque
from typing import List, Dict

View File

@@ -204,9 +204,7 @@ class MaiEmoji:
# 2. 删除数据库记录
try:
async with get_db_session() as session:
result = await session.execute(
select(Emoji).where(Emoji.emoji_hash == self.hash)
)
result = await session.execute(select(Emoji).where(Emoji.emoji_hash == self.hash))
will_delete_emoji = result.scalar_one_or_none()
if will_delete_emoji is None:
logger.warning(f"[删除] 数据库中未找到哈希值为 {self.hash} 的表情包记录。")
@@ -947,10 +945,7 @@ class EmojiManager:
existing_description = None
try:
async with get_db_session() as session:
stmt = select(Images).where(
Images.emoji_hash == image_hash,
Images.type == "emoji"
)
stmt = select(Images).where(Images.emoji_hash == image_hash, Images.type == "emoji")
result = await session.execute(stmt)
existing_image = result.scalar_one_or_none()
if existing_image and existing_image.description: