refactor: use module-level logger in static methods

This commit is contained in:
yorkhellen 2026-05-07 09:14:21 +08:00 committed by Xubin Ren
parent 4773589685
commit 10a0bb0fb3
2 changed files with 1 additions and 4 deletions

View File

@ -19,6 +19,7 @@ from nanobot.command.builtin import build_help_text
from nanobot.config.paths import get_media_dir
from nanobot.config.schema import Base
from nanobot.utils.helpers import safe_filename, split_message
from loguru import logger
DISCORD_AVAILABLE = importlib.util.find_spec("discord") is not None
if TYPE_CHECKING:
@ -314,8 +315,6 @@ if DISCORD_AVAILABLE:
reply_to: str | None,
) -> tuple[discord.PartialMessage | None, discord.AllowedMentions]:
"""Build reply context for outbound messages."""
from loguru import logger
mention_settings = discord.AllowedMentions(replied_user=False)
if not reply_to:
return None, mention_settings

View File

@ -1104,8 +1104,6 @@ class WebSocketChannel(BaseChannel):
Shape: ``list[{"data_url": str, "name"?: str | None}]``.
"""
from loguru import logger
image_count = 0
video_count = 0
for item in media: