diff --git a/.gitignore b/.gitignore index 36226399..738d0097 100644 --- a/.gitignore +++ b/.gitignore @@ -101,4 +101,4 @@ ENV/ .mypy_cache/ \.idea/ -\.vscode/ \ No newline at end of file +\.vscode/ diff --git a/README.md b/README.md index a60022e4..0b93e0f6 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,14 @@ Lavalink.py is a wrapper for [Lavalink](https://github.com/Frederikam/Lavalink) # Getting Started You may clone this repository and check out [the docs](docs/). The docs are not hosted anywhere, or 100% complete at the time of writing. If you notice missing documentation, feel free to [open an issue](https://github.com/Devoxin/Lavalink.py/issues/) or [let us know in the Discord server](https://discord.gg/SbJXU9s). -Additionally, there is an [example cog](lavalink/examples) (For Discord.py rewrite). +Additionally, there is an [example cog](lavalink/examples). It should be noted that the example cog is oriented towards usage with Discord.py rewrite and Lavalink v3.1+, although backwards +compatibility may be possible, it's not encouraged nor is support guaranteed. + +## Optional Dependencies + +`aiodns` - Speed up DNS resolving. + +`cchardet` - A faster alternative to `chardet`. # Links diff --git a/lavalink/examples/music.py b/lavalink/examples/music.py index 0ac57d74..870cef56 100644 --- a/lavalink/examples/music.py +++ b/lavalink/examples/music.py @@ -21,7 +21,11 @@ def __init__(self, bot): bot.lavalink = lavalink.Client(bot.user.id) bot.lavalink.add_node('127.0.0.1', 2333, 'youshallnotpass', 'eu', 'default-node') # Host, Port, Password, Region, Name bot.add_listener(bot.lavalink.voice_update_handler, 'on_socket_response') - bot.lavalink.add_event_hook(self.track_hook) + + bot.lavalink.add_event_hook(self.track_hook) + + def __unload(self): + self.bot.lavalink._event_hooks.clear() async def track_hook(self, event): if isinstance(event, lavalink.events.TrackEndEvent):