From d0e372e8327016bac73ca4f02356291a7499ad2a Mon Sep 17 00:00:00 2001 From: Mantou Date: Tue, 12 Dec 2023 22:50:02 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9BFix(events.py):=20fix=20lavalink=20?= =?UTF-8?q?has=20no=20attribute=20'add=5Fevent=5Fhook'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lava/cogs/events.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lava/cogs/events.py b/lava/cogs/events.py index 778b8dda..fa5c373b 100644 --- a/lava/cogs/events.py +++ b/lava/cogs/events.py @@ -24,9 +24,11 @@ def __init__(self, bot: Bot): async def cog_load(self): await self.bot.wait_until_ready() - - lavalink.add_event_hook(self.track_hook) - + + @commands.Cog.listener(name="on_ready") + async def on_ready(self): + self.bot.lavalink.add_event_hook(self.track_hook) + async def track_hook(self, event): if isinstance(event, PlayerUpdateEvent): player: DefaultPlayer = event.player