Represents a Lavalink client used to manage nodes and connections.

Overview

lavaplayer

Represents a Lavalink client used to manage nodes and connections.

setup

pip install lavaplayer

setup lavalink

you need to java 11* LTS or newer required.

install lavalink last version, create application.yml, run the server

java -jar Lavalink.jar

config lavaplayer server info

from .LavalinkClient() set information connection

host="127.0.0.1",  # server ip address
port=8888,  # port
password="password",  # password authentication
bot_id=123 # bot id

license

take to LICENSE file

Comments
  • Got  'node not found'

    Got 'node not found'

    Hi i started to use your library to play music and i got that error

    Traceback (most recent call last): File "/home/pi/.local/lib/python3.9/site-packages/lightbulb/app.py", line 1154, in invoke_application_command await context.invoke() File "/home/pi/.local/lib/python3.9/site-packages/lightbulb/context/base.py", line 292, in invoke await self.command.invoke(self) File "/home/pi/.local/lib/python3.9/site-packages/lightbulb/commands/base.py", line 544, in invoke await self(context, **kwargs) File "/home/pi/.local/lib/python3.9/site-packages/lightbulb/commands/base.py", line 459, in __call__ return await self.callback(context, **kwargs) File "/home/pi/M.A.R.I.O.N/test_bot/bot.py", line 147, in cmd_play_voice await lavalink.play(ctx.guild_id, result[0], ctx.author.id) # play the first result File "/home/pi/.local/lib/python3.9/site-packages/lavaplayer/client.py", line 295, in play raise NodeError("Node not found", guild_id) lavaplayer.exceptions.NodeError: ('Node not found', 791009507126804511)

    Here is my code

    @lightbulb.add_cooldown(15.0, 1, lightbulb.UserBucket)
    @lightbulb.add_checks(lightbulb.owner_only)
    @lightbulb.option("musique","Ce que vous souhaitez faire lire à M.A.R.I.O.N") # Option definition 1) --> the name of the option 2) --> The description of the option
    @lightbulb.command("play", "Connecter M.A.R.I.O.N")  # Command definition 1) --> the name of the command 2) --> The description of the command
    @lightbulb.implements(lightbulb.SlashCommand) 
    async def cmd_play_voice(ctx: lightbulb.SlashContext):
        await ctx.respond(ctx.member.nickname)
    
        query = ctx.options.musique  # get query from options
        result = await lavalink.auto_search_tracks(query)  # search for the query
        if not result:
            await ctx.respond("not found result for your query")
            return
        
        # Playlist
        if isinstance(result, lavaplayer.PlayList):
            await lavalink.add_to_queue(ctx.guild_id, result.tracks, ctx.author.id)
            await ctx.respond(f"added {len(result.tracks)} tracks to queue")
            return 
        print(result[0])
        print(ctx.author.id)
        print(ctx.guild_id)
        await lavalink.play(ctx.guild_id, result[0], ctx.author.id)  # play the first result
        await ctx.respond(f"[{result[0].title}]({result[0].uri})")  # send the embed```
        
        If you need i can give you the complete file
    opened by Tech-User42 23
  • Lavaplayer won't play audio regardless of connected server

    Lavaplayer won't play audio regardless of connected server

    Describe the bug No matter what Lavalink server I try to connect Lavaplayer to, it won't play any audio.

    To Reproduce

    1. Use lavaplayer 1.0.10a0
    2. Tell the bot to play a song
    3. See the bot trying to play that song
    4. Experience no audio being played back

    Expected behavior The bot should've played the audio or at least I should get an error pointing me to the issue.

    Screenshots I have no screenshots to explain this issue.

    Desktop:

    • OS: Windows 11
    • Browser: Chrome
    • Version: 103

    Smartphone:

    • Device: OnePlus Nord CE 5G
    • OS: Android 12
    • Browser: Chrome
    • Version: 104

    Additional context I have tried using two servers with this library, the preconfigured one at http://lava.link and the one I host myself on the VPS (3.5-rc3), none of them played audio. All I get is a message from the bot claiming it started playing the song, but nothing happened afterwards.

    wontfix 
    opened by piotr25691 10
  • bug skip

    bug skip

    Hello, there is such a bug, if you skip a track at once, and there are only 2 of them, then 2 tracks are skipped.

    lavaplayer last version, nextcrod last version.

    bug invalid 
    opened by Rimuwu 3
  • Add more system info from payload

    Add more system info from payload

    I think it would be a great idea adding more system information about resources being used by lavalink server. The current payload send us many stats. However, in the previous class Info there was only some of them. The new stats are:

    • memory_reservable int
    • memory_allocated int
    • cpu_cores int
    • system_load float
    • lavalink_load float
    opened by agustinemk 1
  • Node not found

    Node not found

    Describe the bug Node not found

    To Reproduce Steps to reproduce the behavior: https://github.com/HazemMeqdad/lavaplayer/blob/main/examples/dpy_base_v2/bot.py this does not work it gives me that error i use windows 11.

    Expected behavior to run normally.

    Screenshots image

    Desktop (please complete the following information):

    • OS: win11
    • Browser ?
    • Version ?
    bug 
    opened by 6ky 1
  • Bump github/codeql-action from 1 to 2

    Bump github/codeql-action from 1 to 2

    Bumps github/codeql-action from 1 to 2.

    Changelog

    Sourced from github/codeql-action's changelog.

    2.1.8 - 08 Apr 2022

    • Update default CodeQL bundle version to 2.8.5. #1014
    • Fix error where the init action would fail due to a GitHub API request that was taking too long to complete #1025

    2.1.7 - 05 Apr 2022

    • A bug where additional queries specified in the workflow file would sometimes not be respected has been fixed. #1018

    2.1.6 - 30 Mar 2022

    • [v2+ only] The CodeQL Action now runs on Node.js v16. #1000
    • Update default CodeQL bundle version to 2.8.4. #990
    • Fix a bug where an invalid commit_oid was being sent to code scanning when a custom checkout path was being used. #956
    Commits
    • 2c03704 Allow the version of the ML-powered pack to depend on the CLI version
    • dd6b592 Simplify ML-powered query status report definition
    • a90d8bf Merge pull request #1011 from github/henrymercer/ml-powered-queries-pr-check
    • dc0338e Use latest major version of actions/upload-artifact
    • 57096fe Add a PR check to validate that ML-powered queries are run correctly
    • b0ddf36 Merge pull request #1012 from github/henrymercer/update-actions-major-versions
    • 1ea2f2d Merge branch 'main' into henrymercer/update-actions-major-versions
    • 9dcc141 Merge pull request #1010 from github/henrymercer/stop-running-ml-powered-quer...
    • ea751a9 Update other Actions from v2 to v3
    • a2949f4 Update actions/checkout from v2 to v3
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 0
  • Exit channels when the bot is turned off.

    Exit channels when the bot is turned off.

    If the bot does not exit the channel and stay in it. Then in the next start it will not play music, because the session is unknown. And you have to disable the bot manually.

    opened by TaIFeel 0
  • Bump actions/checkout from 2 to 3

    Bump actions/checkout from 2 to 3

    Bumps actions/checkout from 2 to 3.

    Release notes

    Sourced from actions/checkout's releases.

    v3.0.0

    • Update default runtime to node16

    v2.4.0

    • Convert SSH URLs like org-<ORG_ID>@github.com: to https://github.com/ - pr

    v2.3.5

    Update dependencies

    v2.3.4

    v2.3.3

    v2.3.2

    Add Third Party License Information to Dist Files

    v2.3.1

    Fix default branch resolution for .wiki and when using SSH

    v2.3.0

    Fallback to the default branch

    v2.2.0

    Fetch all history for all tags and branches when fetch-depth=0

    v2.1.1

    Changes to support GHES (here and here)

    v2.1.0

    Changelog

    Sourced from actions/checkout's changelog.

    Changelog

    v2.3.1

    v2.3.0

    v2.2.0

    v2.1.1

    • Changes to support GHES (here and here)

    v2.1.0

    v2.0.0

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 0
  • (PYL-W0621) Re-defined variable from outer scope

    (PYL-W0621) Re-defined variable from outer scope

    opened by HazemMeqdad 0
  • I am getting a error while connection to the WebSocket

    I am getting a error while connection to the WebSocket

    E 2022-12-30 22:39:49,289 asyncio: Task exception was never retrieved
    future: <Task finished name='Task-23' coro=<WS._connect() done, defined at C:\Users\halfs\AppData\Roaming\Python\Python39\site-packages\lavaplayer\websocket.py:52> exception=AttributeError("'NoneType' object has no attribute 'closed'")>
    Traceback (most recent call last):
      File "C:\Users\halfs\AppData\Roaming\Python\Python39\site-packages\lavaplayer\websocket.py", line 77, in _connect
        await self.send({
      File "C:\Users\halfs\AppData\Roaming\Python\Python39\site-packages\lavaplayer\websocket.py", line 180, in send
        if not self.is_connected:
      File "C:\Users\halfs\AppData\Roaming\Python\Python39\site-packages\lavaplayer\websocket.py", line 177, in is_connected
        return self.is_connect and self.ws.closed is False
    AttributeError: 'NoneType' object has no attribute 'closed'
    
    

    Is this even an error or just randomly spawned crash output ?

    opened by halfstackpgr 3
  • 'CacheMappingView' object has no attribute 'iterator'

    'CacheMappingView' object has no attribute 'iterator'

    Hi I am having an issue with the join_command shown in the hikari / lightbulb example:

    @bot.command() @lightbulb.command(name="join", description="join voice channel") @lightbulb.implements(*implements) async def join_command(ctx: lightbulb.context.Context): states = bot.cache.get_voice_states_view_for_guild(ctx.guild_id) voice_state = [state async for state in states.iterator().filter(lambda i: i.user_id == ctx.author.id)] if not voice_state: await ctx.respond("you are not in a voice channel") return channel_id = voice_state[0].channel_id await bot.update_voice_state(ctx.guild_id, channel_id, self_deaf=True) await lavalink.wait_for_connection(ctx.guild_id) await ctx.respond(f"done join to <#{channel_id}>")

    I cant really seam to find a solution
    
    opened by mart337i 1
  • Cannot use ctx.voice_channel

    Cannot use ctx.voice_channel

    Is your feature request related to a problem? Please describe. if i use ctx.voice_channel the result is always None even the bot is connected to channel. Idk if its bug or feature

    Describe the solution you'd like I would like to use ctx.voice_channel

    Describe alternatives you've considered Switching to different library which i dont want to bcs I like lavaplayer

    Additional context Discusion with discord py dev https://github.com/Rapptz/discord.py/issues/9026

    opened by Karnatour 4
  • Cant play URL from other website since tha API update

    Cant play URL from other website since tha API update

    When i try to play Radio URL with the APi it fails with the message ('Connecting to the URL failed.', 'SUSPICIOUS')

    I havent seen yet any option to force play any url is there any workaround ?

    opened by Tech-User42 1
  • Can't search on Youtube from keywords

    Can't search on Youtube from keywords

    Can't search on Youtube from keywords After the last update i was unable to search a track with lavalink.auto_search_tracks("Electric Six - Danger! High Voltage") It return

     Got request to load for identifier "ytsearch:Electric Six - Danger! High Voltage"
    2022-09-08 17:53:49.655  INFO 2573780 --- [ader-2-thread-1] lavalink.server.player.AudioLoader       : No matches found
    
    opened by Tech-User42 2
Releases(1.0.10a)
Owner
HazemMeqdad
I love Python ❤
HazemMeqdad
The modern Lavalink wrapper designed for discord.py

Pomice The modern Lavalink wrapper designed for discord.py This library is heavily based off of/uses code from the following libraries: Wavelink Slate

Gstone 1 Feb 2, 2022
A fork of lavalink.py built for nextcord

nextcord-ext-lava is a wrapper for Lavalink which abstracts away most of the code necessary to use Lavalink, allowing for easier integration into your projects, while still promising full API coverage and powerful tools to get the most out of it.

nextcord-ext 4 Feb 27, 2022
A powerful Lavalink library for Discord.py.

A robust and powerful Lavalink wrapper for Discord.py! Documentation Official Documentation. Support For support using WaveLink, please join the offic

Pythonista 254 Dec 29, 2022
Stock market bot that will be used to learn about API calls and database connections.

Stock market bot that will be used to learn about API calls and database connections.

null 1 Dec 24, 2021
Tools used by Ada Health's internal IT team to deploy and manage a serverless Munki setup.

Serverless Munki This repository contains cross platform code to deploy a production ready Munki service, complete with AutoPkg, that runs entirely fr

Ada Health 17 Dec 5, 2022
Crud-python-sqlite: used to manage telephone contacts through python and sqlite

crud-python-sqlite This program is used to manage telephone contacts through python and sqlite. Dependencicas python3 sqlite3 Installation Clone the r

Luis Negrón 0 Jan 24, 2022
Hostapd-mac-monitor - Setup a hostapd AP to conntrol the connections of specific MACs

A brief explanation This script provides way to setup a monitoring service of sp

null 2 Feb 3, 2022
Drcom-pt-client - Drcom Pt version client with refresh timer

drcom-pt-client Drcom Pt version client with refresh timer Dr.com Pt版本客户端 可用于网页认

null 4 Nov 16, 2022
Dns-Client-Server - Dns Client Server For Python

Dns-client-server DNS Server: supporting all types of queries and replies. Shoul

Nishant Badgujar 1 Feb 15, 2022
Raphtory-client - The python client for the Raphtory project

Raphtory Client This is the python client for the Raphtory project Install via p

Raphtory 5 Apr 28, 2022
Client to allow skytrack to be used with GSPro Golf simulator application

Skytrack Interface for GSPro A Basic Interface connection from Skytrack Launch Monitors to be able to play simulator golf via GSPro About The Project

James Peruggia 2 Oct 24, 2021
IMDbPY is a Python package useful to retrieve and manage the data of the IMDb movie database about movies, people, characters and companies

IMDbPY is a Python package for retrieving and managing the data of the IMDb movie database about movies, people and companies. Revamp notice Starting

Davide Alberani 1.1k Jan 2, 2023
❤️ Hi There Im EzilaX ❤️ A next gen powerful telegram group manager bot 😱 for manage your groups and have fun with other cool modules Made By Sadew Jayasekara 🔥

❤️ EzilaX v1 ❤️ Unmaintained. The new repo of @EzilaXBot is Public. (It is no longer based on this source code. The completely rewritten bot available

Sadew Jayasekara 18 Nov 24, 2021
Sail is a free CLI tool to deploy, manage and scale WordPress applications in the DigitalOcean cloud.

Deploy WordPress to DigitalOcean with Sail Sail is a free CLI tool to deploy, manage and scale WordPress applications in the DigitalOcean cloud. Conte

Konstantin Kovshenin 159 Dec 12, 2022
❤️A next gen powerful telegram group manager bot for manage your groups and have fun with other cool modules

Natsuki Based on Python Telegram Bot Contributors Video Tutorial: Complete guide on deploying @TheNatsukiBot's clone on Heroku. ☆ Video by Sadew Jayas

Pawan Theekshana 8 Oct 6, 2022
Amanda-A next gen powerful telegram group manager bot for manage your groups and have fun with other cool modules.

Amanda-A next gen powerful telegram group manager bot for manage your groups and have fun with other cool modules.

Team Amanda 4 Oct 21, 2022
a discord libary that use to make discord bot with low efficiency and bad performance because I don't know how to manage the project

Aircord ??️ a discord libary that use to make discord bot with low efficiency and bad performance because I don't know how to manage the project Examp

Aircord 2 Oct 24, 2021
Cloudkeeper is “housekeeping for clouds” - find leaky resources, manage quota limits, detect drift and clean up.

Cloudkeeper Housekeeping for Clouds! Table of contents Overview Docker based quick start Cloning this repository Component list Contact License Overvi

Some Engineering 1.2k Jan 3, 2023
SquireBot is a Discord bot designed to run and manage tournaments entirely within a Discord.

Overview SquireBot is a Discord bot designed to run and manage tournaments entirely within a Discord. The current intended usecase is Magic: the Gathe

null 7 Nov 29, 2022