Skip to main content

A robust and powerful Lavalink wrapper for disnake and derivatives.

Project description

https://raw.githubusercontent.com/realstealthninja/Stealthy-wavelink/main/logo.png https://img.shields.io/badge/Python-3.8%20%7C%203.9%20%7C%203.10-blue.svg https://img.shields.io/github/license/EvieePy/Wavelink.svg https://img.shields.io/discord/926115595307614249?color=%237289DA&label=Pythonista&logo=discord&logoColor=white Maintenance

Stealthy-Wavelink is a robust and powerful Lavalink wrapper for Disnake. As it is forked from wavelink it features a fully asynchronous API that’s intuitive and easy to use with built in Spotify Support and Node Pool Balancing.

Documentation

Unofficial Documentation Untill i make mine

Support

For support using Stealthy-waveLink, please join the official support server on Discord.

https://discordapp.com/api/guilds/926115595307614249/widget.png?style=banner2

Installation

The following commands are currently the valid ways of installing WaveLink.

WaveLink requires Python 3.8+

Windows

py -3.9 -m pip install -U git+https://github.com/realstealthninja/Stealthy-wavelink

Linux

python3.9 -m pip install -U git+https://github.com/realstealthninja/Stealthy-wavelink

Getting Started

A quick and easy bot example:

import wavelink
from disnake.ext import commands


class Bot(commands.Bot):

    def __init__(self):
        super().__init__(command_prefix='>?')

    async def on_ready(self):
        print('Bot is ready!')


class Music(commands.Cog):
    """Music cog to hold Wavelink related commands and listeners."""

    def __init__(self, bot: commands.Bot):
        self.bot = bot

        bot.loop.create_task(self.connect_nodes())

    async def connect_nodes(self):
        """Connect to our Lavalink nodes."""
        await self.bot.wait_until_ready()

        await wavelink.NodePool.create_node(bot=bot,
                                            host='0.0.0.0',
                                            port=2333,
                                            password='YOUR_LAVALINK_PASSWORD')

    @commands.Cog.listener()
    async def on_wavelink_node_ready(self, node: wavelink.Node):
        """Event fired when a node has finished connecting."""
        print(f'Node: <{node.identifier}> is ready!')

    @commands.command()
    async def play(self, ctx: commands.Context, *, search: wavelink.YouTubeTrack):
        """Play a song with the given search query.

        If not connected, connect to our voice channel.
        """
        if not ctx.voice_client:
            vc: wavelink.Player = await ctx.author.voice.channel.connect(cls=wavelink.Player)
        else:
            vc: wavelink.Player = ctx.voice_client

        await vc.play(search)


bot = Bot()
bot.add_cog(Music(bot))
bot.run('YOUR_BOT_TOKEN')

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

Stealthy-wavelink-1.1.1.tar.gz (102.3 kB view details)

Uploaded Source

Supported by

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