Skip to content

Commit

Permalink
[Medicat] Fix blocking during bot loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
AAA3A-AAA3A committed May 12, 2024
1 parent cb21688 commit 27d51ab
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions medicat/medicat.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,6 @@ def __init__(self, bot: Red) -> None:

async def cog_load(self) -> None:
await super().cog_load()
global MEDICAT_ICON_URL
MEDICAT_ICON_URL = (await self.bot.fetch_invite("medicat")).guild.icon.url
await self.edit_config_schema()
self._session: aiohttp.ClientSession = aiohttp.ClientSession()
self.loops.append(
Expand All @@ -373,6 +371,12 @@ async def cog_load(self) -> None:
)
self.CC_added: asyncio.Event = asyncio.Event()
await self.add_custom_commands()
asyncio.create_task(self.cog_after_load())

async def cog_after_load(self) -> None:
await self.bot.wait_until_red_ready()
global MEDICAT_ICON_URL
MEDICAT_ICON_URL = (await self.bot.fetch_invite("medicat")).guild.icon.url

async def red_delete_data_for_user(self, *args, **kwargs) -> None:
"""Nothing to delete."""
Expand Down

0 comments on commit 27d51ab

Please sign in to comment.