From 5de3fd77bf356b0dc7f4962bd58386924ecb9ce8 Mon Sep 17 00:00:00 2001 From: Interitio Date: Tue, 27 Aug 2024 17:30:10 +1000 Subject: [PATCH] fix (core): Adjustment for psy and disc updates. --- src/data/cursor.py | 4 ++-- src/meta/LionBot.py | 2 +- src/meta/LionTree.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/data/cursor.py b/src/data/cursor.py index 5e01a8d..5d183e0 100644 --- a/src/data/cursor.py +++ b/src/data/cursor.py @@ -3,7 +3,7 @@ from typing import Optional from psycopg import AsyncCursor, sql from psycopg.abc import Query, Params -from psycopg._encodings import pgconn_encoding +from psycopg._encodings import conn_encoding logger = logging.getLogger(__name__) @@ -15,7 +15,7 @@ class AsyncLoggingCursor(AsyncCursor): elif isinstance(query, (sql.SQL, sql.Composed)): msg = query.as_string(self) elif isinstance(query, bytes): - msg = query.decode(pgconn_encoding(self._conn.pgconn), 'replace') + msg = query.decode(conn_encoding(self._conn.pgconn), 'replace') else: msg = repr(query) return msg diff --git a/src/meta/LionBot.py b/src/meta/LionBot.py index 88fa0b2..fed52d8 100644 --- a/src/meta/LionBot.py +++ b/src/meta/LionBot.py @@ -191,7 +191,7 @@ class LionBot(Bot): # TODO: Some of these could have more user-feedback logger.debug(f"Handling command error for {ctx}: {exception}") if isinstance(ctx.command, HybridCommand) and ctx.command.app_command: - cmd_str = ctx.command.app_command.to_dict() + cmd_str = ctx.command.app_command.to_dict(self.tree) else: cmd_str = str(ctx.command) try: diff --git a/src/meta/LionTree.py b/src/meta/LionTree.py index 3ce097b..a0697f0 100644 --- a/src/meta/LionTree.py +++ b/src/meta/LionTree.py @@ -131,7 +131,7 @@ class LionTree(CommandTree): return set_logging_context(action=f"Run {command.qualified_name}") - logger.debug(f"Running command '{command.qualified_name}': {command.to_dict()}") + logger.debug(f"Running command '{command.qualified_name}': {command.to_dict(self)}") try: await command._invoke_with_namespace(interaction, namespace) except AppCommandError as e: