fix: F821 undefined name errors in channels

This commit is contained in:
yorkhellen
2026-05-07 13:07:22 +08:00
committed by Xubin Ren
parent 4a4e0af0ba
commit 4773589685
4 changed files with 9 additions and 4 deletions
+3 -1
View File
@@ -314,13 +314,15 @@ 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
try:
message_id = int(reply_to)
except ValueError:
self._channel.logger.warning("Invalid reply target: {}", reply_to)
logger.warning("Invalid reply target: {}", reply_to)
return None, mention_settings
return channel.get_partial_message(message_id), mention_settings