Skip to main content

Minimalistic lavalink wrapper based on wavelink. Made for Pycord.

Project description


Make sure you have a running lavalink server.


pip install git+

Basic example

import discord
import pisslink
import re

from discord.commands import slash_command
from discord.ext import commands

YOUTUBE_REGEX = re.compile(r'^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?$')

class Client(discord.Bot):

    def __init__(self):

class Music(commands.Cog):

    def __init__(self, client):
        self.client = client

    async def node(self):
        await self.client.wait_until_ready()
        await pisslink.NodePool.create_node(
            client = self.client,
            host = '',
            port = 2333,
            password = 'youshallnotpass'

    async def play(self, ctx, query):
        '''Play a song from youtube.'''
        player = ctx.voice_client
        await ctx.defer()
        if not player: # try to connect to the voice channel
            if not
                return await ctx.respond('You are not connected to a voice channel.')
                    channel =
                    await channel.connect(cls=pisslink.Player())
                    player = ctx.voice_client
                except discord.Forbidden:
                    return await ctx.respond('I do not have access to this channel.')
        if not or != # check if author is in same channel as the bot
            await ctx.respond('You must be in the same channel as the bot.')
            if YOUTUBE_REGEX.match(query): # check if query is url.
                track = await pisslink.PisslinkTrack.get(query, return_first=True)
            else: # query is not a url
                track = await, return_first=True)
            if not track: # check if track was found
                await ctx.respond('Song not found.')
            else: # play the track
                await ctx.respond(f'Playing {track.title}.')

client = Client()

For advanced usage see

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pisslink-1.0.2.tar.gz (10.8 kB view hashes)

Uploaded source

Built Distribution

pisslink-1.0.2-py3-none-any.whl (12.5 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page