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 import AsyncCursor, sql
from psycopg.abc import Query, Params from psycopg.abc import Query, Params
from psycopg._encodings import pgconn_encoding from psycopg._encodings import conn_encoding
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@@ -15,7 +15,7 @@ class AsyncLoggingCursor(AsyncCursor):
elif isinstance(query, (sql.SQL, sql.Composed)): elif isinstance(query, (sql.SQL, sql.Composed)):
msg = query.as_string(self) msg = query.as_string(self)
elif isinstance(query, bytes): elif isinstance(query, bytes):
msg = query.decode(pgconn_encoding(self._conn.pgconn), 'replace') msg = query.decode(conn_encoding(self._conn.pgconn), 'replace')
else: else:
msg = repr(query) msg = repr(query)
return msg return msg

View File

@@ -191,7 +191,7 @@ class LionBot(Bot):
# TODO: Some of these could have more user-feedback # TODO: Some of these could have more user-feedback
logger.debug(f"Handling command error for {ctx}: {exception}") logger.debug(f"Handling command error for {ctx}: {exception}")
if isinstance(ctx.command, HybridCommand) and ctx.command.app_command: 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: else:
cmd_str = str(ctx.command) cmd_str = str(ctx.command)
try: try:

View File

@@ -131,7 +131,7 @@ class LionTree(CommandTree):
return return
set_logging_context(action=f"Run {command.qualified_name}") 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: try:
await command._invoke_with_namespace(interaction, namespace) await command._invoke_with_namespace(interaction, namespace)
except AppCommandError as e: except AppCommandError as e: