Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions astrbot/core/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ class LogManager:
"asyncio": logging.WARNING,
"tzlocal": logging.WARNING,
"apscheduler": logging.WARNING,
"httpx": logging.WARNING,
"httpcore": logging.WARNING,
}

@classmethod
Expand Down
11 changes: 9 additions & 2 deletions astrbot/core/platform/sources/telegram/tg_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,19 @@ async def run(self) -> None:
await asyncio.sleep(self._polling_restart_delay)

def _on_polling_error(self, error: Exception) -> None:
# Non-network errors (e.g. Conflict when two bot instances poll the
# same token) have a clear cause; log a concise message instead of a
# full traceback to avoid filling the log.
if not isinstance(error, NetworkError):
logger.error(
f"Telegram polling request failed: {type(error).__name__}: {error!s}"
)
return

logger.error(
f"Telegram polling request failed: {type(error).__name__}: {error!s}",
exc_info=error,
)
if not isinstance(error, NetworkError):
return

if self._loop is None:
return
Expand Down
Loading