Skip to content

Commit

Permalink
🐛Fix(events.py): fix lavalink has no attribute 'add_event_hook'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mantouisyummy committed Dec 12, 2023
1 parent e46c144 commit d0e372e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lava/cogs/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d0e372e

Please sign in to comment.