Minor bugfixes and adjustment for new dpy.
This commit is contained in:
@@ -118,7 +118,6 @@ class CoreCog(LionCog):
|
|||||||
await self.bot.remove_cog(self.lions.qualified_name)
|
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_join')
|
||||||
self.bot.remove_listener(self.shard_update_guilds, name='on_guild_leave')
|
self.bot.remove_listener(self.shard_update_guilds, name='on_guild_leave')
|
||||||
self.bot.core = None
|
|
||||||
|
|
||||||
@LionCog.listener('on_ready')
|
@LionCog.listener('on_ready')
|
||||||
@log_wrap(action='Touch shard data')
|
@log_wrap(action='Touch shard data')
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ class Connector:
|
|||||||
return AsyncConnectionPool(
|
return AsyncConnectionPool(
|
||||||
self._conn_args,
|
self._conn_args,
|
||||||
open=False,
|
open=False,
|
||||||
min_size=4,
|
min_size=1,
|
||||||
max_size=8,
|
max_size=4,
|
||||||
configure=self._setup_connection,
|
configure=self._setup_connection,
|
||||||
kwargs=self._conn_kwargs
|
kwargs=self._conn_kwargs
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -320,7 +320,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:
|
||||||
|
|||||||
@@ -152,7 +152,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!r}")
|
||||||
try:
|
try:
|
||||||
await command._invoke_with_namespace(interaction, namespace)
|
await command._invoke_with_namespace(interaction, namespace)
|
||||||
except AppCommandError as e:
|
except AppCommandError as e:
|
||||||
|
|||||||
@@ -101,8 +101,9 @@ class Shopping(LionCog):
|
|||||||
self.active_cogs.append(shop_cog)
|
self.active_cogs.append(shop_cog)
|
||||||
|
|
||||||
async def cog_unload(self):
|
async def cog_unload(self):
|
||||||
for shop in self.shops:
|
# for shop in self.shops:
|
||||||
await shop.unload()
|
# await shop.unload()
|
||||||
|
pass
|
||||||
|
|
||||||
@cmds.hybrid_group(
|
@cmds.hybrid_group(
|
||||||
name=_p('group:editshop', 'editshop')
|
name=_p('group:editshop', 'editshop')
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class SponsorCog(LionCog):
|
|||||||
def __init__(self, bot: LionBot):
|
def __init__(self, bot: LionBot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.data: SponsorData = bot.db.load_registry(SponsorData())
|
self.data: SponsorData = bot.db.load_registry(SponsorData())
|
||||||
self.settings = SponsorSettings
|
self.settings = SponsorSettings()
|
||||||
|
|
||||||
self.whitelisted = self.settings.Whitelist._cache
|
self.whitelisted = self.settings.Whitelist._cache
|
||||||
|
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ class PresenceCtrl(LionCog):
|
|||||||
async def reload_presence(self) -> None:
|
async def reload_presence(self) -> None:
|
||||||
# Reload the presence information from the appconfig table
|
# Reload the presence information from the appconfig table
|
||||||
# TODO: When botconfig is done, these should load from settings, instead of directly from data
|
# 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_type = (await self.settings.PresenceType.get(appname)).value.value[2]
|
||||||
self.activity_format = (await self.settings.PresenceName.get(appname)).value
|
self.activity_format = (await self.settings.PresenceName.get(appname)).value
|
||||||
self.status = (await self.settings.PresenceStatus.get(appname)).value.value[2]
|
self.status = (await self.settings.PresenceStatus.get(appname)).value.value[2]
|
||||||
|
|||||||
Reference in New Issue
Block a user