fix (core): Adjustment for psy and disc updates.

This commit is contained in:
2024-08-27 17:30:10 +10:00
parent 873def8456
commit 5de3fd77bf
3 changed files with 4 additions and 4 deletions

View File

@@ -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

View File

@@ -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:

View File

@@ -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: