Minor bugfixes and adjustment for new dpy.

This commit is contained in:
2024-07-11 15:35:45 +10:00
parent d3a14cb9ea
commit b0e11fef56
7 changed files with 9 additions and 9 deletions

View File

@@ -118,7 +118,6 @@ class CoreCog(LionCog):
await self.bot.remove_cog(self.lions.qualified_name)
self.bot.remove_listener(self.shard_update_guilds, name='on_guild_join')
self.bot.remove_listener(self.shard_update_guilds, name='on_guild_leave')
self.bot.core = None
@LionCog.listener('on_ready')
@log_wrap(action='Touch shard data')

View File

@@ -47,8 +47,8 @@ class Connector:
return AsyncConnectionPool(
self._conn_args,
open=False,
min_size=4,
max_size=8,
min_size=1,
max_size=4,
configure=self._setup_connection,
kwargs=self._conn_kwargs
)

View File

@@ -320,7 +320,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

@@ -152,7 +152,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!r}")
try:
await command._invoke_with_namespace(interaction, namespace)
except AppCommandError as e:

View File

@@ -101,8 +101,9 @@ class Shopping(LionCog):
self.active_cogs.append(shop_cog)
async def cog_unload(self):
for shop in self.shops:
await shop.unload()
# for shop in self.shops:
# await shop.unload()
pass
@cmds.hybrid_group(
name=_p('group:editshop', 'editshop')

View File

@@ -20,7 +20,7 @@ class SponsorCog(LionCog):
def __init__(self, bot: LionBot):
self.bot = bot
self.data: SponsorData = bot.db.load_registry(SponsorData())
self.settings = SponsorSettings
self.settings = SponsorSettings()
self.whitelisted = self.settings.Whitelist._cache

View File

@@ -284,7 +284,7 @@ class PresenceCtrl(LionCog):
async def reload_presence(self) -> None:
# Reload the presence information from the appconfig table
# TODO: When botconfig is done, these should load from settings, instead of directly from data
self.data.AppPresence._cache_.pop(appname, None)
self.data.AppPresence._cache_.pop((appname,), None)
self.activity_type = (await self.settings.PresenceType.get(appname)).value.value[2]
self.activity_format = (await self.settings.PresenceName.get(appname)).value
self.status = (await self.settings.PresenceStatus.get(appname)).value.value[2]