fix(hotreload): mark cog_load and cog_unload as async

This commit is contained in:
cswimr 2025-01-26 00:46:00 +00:00
parent 18ba837467
commit f233a7dec5
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087

View file

@ -16,7 +16,7 @@ class HotReload(commands.Cog):
__author__ = ["[cswimr](https://www.coastalcommits.com/cswimr)"]
__git__ = "https://www.coastalcommits.com/cswimr/SeaCogs"
__version__ = "1.1.1"
__version__ = "1.1.2"
__documentation__ = "https://seacogs.coastalcommits.com/hotreload/"
def __init__(self, bot: Red) -> None:
@ -28,11 +28,11 @@ class HotReload(commands.Cog):
for watchdog_logger in watchdog_loggers:
watchdog_logger.setLevel("INFO") # SHUT UP!!!!
def cog_load(self) -> None:
async def cog_load(self) -> None:
"""Start the observer when the cog is loaded."""
self.bot.loop.create_task(self.start_observer())
def cog_unload(self) -> None:
async def cog_unload(self) -> None:
"""Stop the observer when the cog is unloaded."""
if self.observer:
self.observer.stop()