Lavalink client library for Red-DiscordBot
Project description
A Lavalink client library written for Python 3.5 using the AsyncIO framework. This library may be used for other projects as it contains no Red specific code or logic.
However, it is important to note that this library only supports projects using discord.py.
To install:
pip install red-lavalink
Usage
import lavalink
from discord.ext.commands import Bot
bot = Bot()
@bot.event
async def on_ready():
lavalink.initialize(
bot, host='localhost', password='password',
rest_port=2332, ws_port=2333
)
async def search_and_play(voice_channel, search_terms):
player = await lavalink.connect(voice_channel)
tracks = await player.search_yt(search_terms)
player.add(tracks[0])
await player.play()
When shutting down, be sure to do the following:
await lavalink.close()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Red-Lavalink-0.3.0.tar.gz
(13.5 kB
view hashes)
Built Distribution
Close
Hashes for Red_Lavalink-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bc685a5d89660875d07f50060bacc820e69a763a581ce69375c792e16df4081 |
|
MD5 | 0de2a3d183b8d6c732b58b91c9c3bc5f |
|
BLAKE2b-256 | 2090b87606746822b375b26b968d0543fa9dca33d39515d7480c0667bb0c8ea4 |