A lavalink wrapper in Node.js

Overview
Comments
  • Use Vulkava without the built-in player queue

    Use Vulkava without the built-in player queue

    Currently I see that the play method of the Player class checks the queue of the music player and in case there are no more songs it throws an error.

    I don't want to use the built-in queue because I want to use my own queue but I don't see an option to disable the already built-in queue.

    enhancement 
    opened by kaname-png 8
  • Fixed track thumbnail is always undefined

    Fixed track thumbnail is always undefined

    Response track thumbnail results are always undefined, however, there's no property that exists called data.info.thumbnail. YouTube videos always will have video ID, by using that ID we can get video thumbnails instead of relying on lavalink.

    Before: image

    After: image

    As we can see there's no property existing name thumbnail image

    opened by rilysh 3
  • Add get tracks method to DefaultQueue

    Add get tracks method to DefaultQueue

    Although we can extend the DefaultQueue class we can also access tracks property on the DefaultQueue class by default so there is no sense it not being reachable x)

    opened by Kara0016 2
  • Lib fails to function when processing certain links

    Lib fails to function when processing certain links

    When playing certain links e.g. Spotify links, the lib fails to function completely for some reason. I'm not sure why this happens but i get a range of errors when attempting to queue a spotify song.

    Error 1:

    vulkava\lib\Player.js:279
                track: this.current.encodedTrack,
    
    TypeError: Cannot read properties of undefined (reading 'encodedTrack')
    

    Error 2:

    (Track Exception) TypeError: Cannot read properties of undefined (reading 'setRequester')
    

    Cause: I've narrowed it down to it only ocurring when coming in contact with an unresolved track, The error in the code is caused by the lib originating from:

    vulkava\lib\UnresolvedTrack.js:35
    

    Vulkava Version: 1.5.6

    bug 
    opened by Seek0999 1
  • feat(queue): get instance of the player in the play queue

    feat(queue): get instance of the player in the play queue

    This is useful to know which server is using the play queue and more information about the current player in the play queue.

    I do this PR because I ran into the problem that for example the clear() method does not receive any parameters however my play queue is database based so I need to know which server to clear the play queue to, with this PR I will get the information I need about the server and the player in the play queue.

    opened by kaname-png 1
  • Suggestion

    Suggestion

    Would it be possible to maybe create a discord server about this lib so people could receive help etc inside of the discord server,

    Would help out quite a bit, If there is already a server could you link me to it?

    Thanks!

    opened by Seek0999 1
  • Player queue abstraction

    Player queue abstraction

    Adds abstraction for player queue.

    • The custom queue must extend AbstractQueue class (see DefaultQueue.ts example)

    How to inject a custom queue instance:

    const myCustomQueue = new MyQueue();
    
    const player = <vulkava>.createPlayer({
        // (...)
        queue: myCustomQueue
    });
    

    Closes #11

    opened by davidffa 0
Releases(v1.5.10)
  • v1.5.10(Dec 4, 2022)

    • Update dependencies (https://github.com/davidffa/Vulkava/commit/b86a50607254d6d64599a7beae40bfcaa3d32099)
    • Fix apple music token extraction (https://github.com/davidffa/Vulkava/commit/bbd2519db0f0c5c53a342066457968c83c10eb3b)
    Source code(tar.gz)
    Source code(zip)
  • v1.5.9(Sep 4, 2022)

    • Ensure that the query in Vulkava#search is a valid string (https://github.com/davidffa/Vulkava/commit/98fa3ed34dde4b480fd9584bab9db69dce151c8c)
    • Bug fix and optimize voice channel connections (Player#connect()) (https://github.com/davidffa/Vulkava/commit/192f7092672b5c6960c69ba63085dd1d91747565, https://github.com/davidffa/Vulkava/commit/745e96565db208aeb95babfbd8c8c557d2215704)
    Source code(tar.gz)
    Source code(zip)
  • v1.5.8(Sep 3, 2022)

    • Update dependencies (https://github.com/davidffa/Vulkava/commit/8b5b7b40fe9300d60c68f7a8d9fad0fa1b123501)
    • Make queue tracks array public (https://github.com/davidffa/Vulkava/commit/e2b7097383ad3f03c71529705db732229573c676)
    Source code(tar.gz)
    Source code(zip)
  • v1.5.7(Aug 20, 2022)

    • Use format: 'PCM' | 'MP3' property on recorder instead of encodeToMp3 (https://github.com/davidffa/Vulkava/commit/f6387ecf68363cfc41254972bd8d5ad1ddbe1cd0)
    • Bug fix when building UnresolvedTracks and get a SEARCH_RESULT with an empty track array (https://github.com/davidffa/Vulkava/commit/12fe44ab358d7ea2e465d6b577637fe5741dea6c)
    • Fix typo in userDisconnect event, now is properly emitted (https://github.com/davidffa/Vulkava/commit/f19a444125f0d0b363f66d4ccd004010bfa3a71a)
    • Bug fix on voice channel connections which was throwing timeout error if the voice_state_update event was received after the voice_server_update (https://github.com/davidffa/Vulkava/commit/47630eb91f9cf33e74a55fd6adeaba6b26e9fc9d)
    • Bump undici to 5.9.1 and update dev dependencies (https://github.com/davidffa/Vulkava/commit/16b4c7b56b9011c30e2c1f912f6c887498bcd469)
    Source code(tar.gz)
    Source code(zip)
  • v1.5.6(Aug 9, 2022)

  • v1.5.5(Aug 8, 2022)

    • Force voice channel disconnection in Player#disconnect(). If for some reason the bot is in the voice channel without being tracked by vulkava, it will be disconnected. (https://github.com/davidffa/Vulkava/commit/ec3934808d8d951471d3f7aa2bedf6e4907109b6)
    • Set default unresolved search source to youtube instead of youtube music (https://github.com/davidffa/Vulkava/commit/6b3471835e15dceac90763b0460b7a3a3d68aad1)
    Source code(tar.gz)
    Source code(zip)
  • v1.5.4(Aug 5, 2022)

    • Clear connectTimeout in Player#disconnect(), now it won't throw connection timed out when destroying the player before the voice channel connection is established. (https://github.com/davidffa/Vulkava/commit/4a0bec457abeb6b689ace0823a9aee128379ef06)
    • Bump undici to 5.8.1 & update dev deps (https://github.com/davidffa/Vulkava/commit/6a9c963bf956278ecff8f9f61e19a3a978e2331c)
    Source code(tar.gz)
    Source code(zip)
  • v1.5.3(Jul 21, 2022)

  • v1.5.2(Jul 11, 2022)

    Emit trackException instead of error event on unresolved track build failure (https://github.com/davidffa/Vulkava/commit/ad6e256898ba8f43bc0e5d9086aa8f10d419ec27)

    Source code(tar.gz)
    Source code(zip)
  • v1.5.1(Jul 11, 2022)

    • Fire error event when fail to build unresolved tracks (https://github.com/davidffa/Vulkava/commit/75dc4456c4ccbecfe28831b2b78fabab25e0d21b)
    Source code(tar.gz)
    Source code(zip)
  • v1.5.0(Jul 8, 2022)

    Changelog

    • Set penalties to 0 on recently connected node (https://github.com/davidffa/Vulkava/commit/e3554e18be494a45f33354143171dcacdc284f97)
    • Change wsDisconnect event to playerDisconnect (https://github.com/davidffa/Vulkava/commit/4d3b0943f5c2a0179176fae120f1b0c0bf96c348)
    • Add playerCreate and playerDestroy events (https://github.com/davidffa/Vulkava/commit/684a3f9e713b00dfc9a6a4d36deb6429f19d1322)
    • Add voice receive support and Player#setSelfDeaf & Player#setSelfMute (https://github.com/davidffa/Vulkava/commit/2d6ead7ebf11bb940383bd4cd3ebea91255b2ac7, https://github.com/davidffa/Vulkava/commit/249567093f86e31adefce678bba96c94bbbbc9e4, https://github.com/davidffa/Vulkava/commit/ee4ac5d64932d27023d5247a9691fe876be61788)
      • See example recorder bot here
    Source code(tar.gz)
    Source code(zip)
  • v1.4.0(Jun 21, 2022)

    Changelog

    • Abstracted the player queue
    • Update depdendencies

    Using a custom queue

    class MyQueue extends DefaultQueue {
        constructor() {
            super(); // Needed to initialize `this.tracks`
        }
    
        // new method
        addTracks(tracks) {
            this.tracks = this.tracks.concat(tracks);
        }
    }
    
    // When creating new players
    const player = vulkava.createPlayer({
        // guildId, voiceChannelId...,
        queue: new MyQueue()
    });
    

    P.S.: If you want to re-implement all of DefaultQueue methods, extend AbstractQueue class.

    Deprecations

    • Player.queueDuration -> Player.queue.duration
    • Player.shuffleQueue() -> Player.queue.shuffle()
    • Player.queue.push() -> Player.queue.add()

    Breaking changes

    • Now player.queue isn't an array anymore, so all of the player.queue array methods and properties were removed. See the new methods and properties on DefaultQueue, or implement your own Queue class (see above).
    Source code(tar.gz)
    Source code(zip)
  • v1.3.1(Jun 15, 2022)

    • Bug fix when moving node (the old player was being destroyed before the lib receives the trackstart, so player.playing was false and the lib didn't send the play payload to the new node) (https://github.com/davidffa/Vulkava/commit/30c3523c0139f2761c92bbb9211e193c8e85bbf0)
    Source code(tar.gz)
    Source code(zip)
  • v1.3.0(Jun 14, 2022)

    Changelog

    • Update dependencies

    • Refactored external sources code (Spotify, Deezer, AppleMusic) (https://github.com/davidffa/Vulkava/commit/ceee5e51f281f44e3cae66ea577a9d178f7bd7b6, https://github.com/davidffa/Vulkava/commit/021a055a3d1e051bb02e792a7b987b9b65975508)

      • Now you can implement your own external source by creating a class that extends AbstractExternalSource, and add its instance with .addExternalSource()
      • Vulkava#search will call the loadItem method on your custom class (You can see an example here)
      • Now the errors are handled, (eg spotify track not found will return a search result with loadType: LOAD_FAILED)
    • Add unit tests for external sources (https://github.com/davidffa/Vulkava/commit/7b47b329024cdca1a9a268b233c35112e68be8d9)

    Source code(tar.gz)
    Source code(zip)
  • v1.2.4(Apr 13, 2022)

    • Move to best node on socket close (https://github.com/davidffa/Vulkava/commit/46db783711efc6c7061aaf15d309ef22f3ef0ecf)
    • Allow disabling external sources (apple music, deezer, spotify) (https://github.com/davidffa/Vulkava/commit/0fa8e746cd9fbcd7217836361fa483a43a1d7ea9)
    Source code(tar.gz)
    Source code(zip)
  • v1.2.3(Apr 10, 2022)

  • v1.2.2(Apr 9, 2022)

    • Improve node loadbalancing (https://github.com/davidffa/Vulkava/commit/8e694fda314bfecec56e6c377390007f3fd3d4cc)
    • Queue outgoing packets if the node socket isn't open (https://github.com/davidffa/Vulkava/commit/fbb10a519eb05c97d60970a2a6e66f321a682e05, https://github.com/davidffa/Vulkava/commit/6cdbde4d6a99f2af9116c4f926cf409fcf8970b1)
    Source code(tar.gz)
    Source code(zip)
  • v1.2.1(Apr 2, 2022)

  • v1.2.0(Apr 2, 2022)

    • Use undici for http requests instead of http/https native modules (https://github.com/davidffa/Vulkava/commit/8f39a8510fe455fd90425faba7f77b2aec2de0a2)
    • Remove warn for unhandled player events (https://github.com/davidffa/Vulkava/commit/a319a20df76c6a90c3f540e27657e86ed7098706)
    Source code(tar.gz)
    Source code(zip)
  • v1.1.4(Apr 2, 2022)

    • Set current track to null on queueEnd (https://github.com/davidffa/Vulkava/commit/1822b269ded127bd654b6702f18b9eb6b6342395)
    • Emit warn event on packet drops (https://github.com/davidffa/Vulkava/commit/9c6863ea8f86a22c92bb0815f31a770026ac5ae4)
    • Add voice connection timeout error (https://github.com/davidffa/Vulkava/commit/79416da56ebce58408bff4d52697c280d9b3304f)
    Source code(tar.gz)
    Source code(zip)
  • v1.1.3(Mar 11, 2022)

    • Fix 100+ tracks spotify playlists load (https://github.com/davidffa/Vulkava/commit/33b162a11778c74f773cf8907bf3b8ff17f150c7)
    • Add followRedirects Node option (https://github.com/davidffa/Vulkava/commit/db124ad057bab83eaef62e974fbf66468ec310a3)
    Source code(tar.gz)
    Source code(zip)
  • v1.1.2(Feb 21, 2022)

  • v1.1.1(Feb 20, 2022)

  • v1.1.0(Feb 20, 2022)

  • v1.0.13(Feb 13, 2022)

    • Bug fixes (https://github.com/davidffa/Vulkava/commit/d640d6bc43e20faaa657c1e9f2a4b60b779da9c0, https://github.com/davidffa/Vulkava/commit/cb9bf86017c78b36d39874b7c0ea5e1f3b7af1d6, https://github.com/davidffa/Vulkava/commit/393918d9eeeb6acf291e6f99492f157a9716306a)
    • Update dependencies (https://github.com/davidffa/Vulkava/commit/90ee5ab3c623a7885aeacd11675bb674b463f9a9)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.12(Feb 6, 2022)

  • v1.0.11(Feb 6, 2022)

    • Fix wrong Player#exactPosition with timescale filter applied (https://github.com/davidffa/Vulkava/commit/731a8c7db90293100466955532e23d5bf6b0c643)
    • Only fetch lavalink versions on my lavalink version (https://github.com/davidffa/Vulkava/commit/a22602efbfa5be0c514d989b026829c75835c7b0)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.10(Jan 26, 2022)

    • Use Spotify anonymous token, if no spotify credentials provided (https://github.com/davidffa/Vulkava/commit/9862f95800c005bfb6cace9ccd163ca847c2f4f2)
    • Bug fix (https://github.com/davidffa/Vulkava/commit/036db210ba2a8e20cd7b072817d8964ba4b64737)
    Source code(tar.gz)
    Source code(zip)
Owner
David Amorim
A nice guy. 18y
David Amorim
A lavalink wrapper in Node.js

Vulkava A lavalink wrapper in Node.JS Documentation Common errors/Issues ?? Installation You will need NodeJS v14+ and a running lavalink server. Offi

David Amorim 26 Dec 17, 2022
An adorable lavalink discord music bot that has a lot of features inside it.

Laffey An adorable lavalink discord music bot that has a lot of features inside it. First Project of Weeb-Devs Features: ✓ High quality ✓ Support filt

null 81 Dec 31, 2022
Music bot that uses Lavalink for its audio player

Msv Music ?? A Advanced Discord Music Bot Made With Lavalink And Have Many Premium Features with filters and more willl be add soon About Msv Music ??

M s v 36 Jan 4, 2022
A Discord.js Music Bot, which connects via Lavalink and erela.js

Discord.js Lavalink Music Bot using erela.js A Advance Discord Music Bot Like Hydra Erela.js docs Note this Discord Bot Repository is the Same as for

ᴋᴀʙɪʀ々ꜱɪɴɢʜ 47 Dec 9, 2022
The node.js v18 API wrapper for discordlist.gg

About This is an unofficial discordlist.gg package written for Typecript and JavaScript to interact with its public API. If you need help using this p

Lunish 5 Dec 13, 2022
Easiest medium to use buttons with any discord API wrapper

Discord Buttons Plugin Easiest medium to use buttons with any discord API wrapper /* Generate 1st Button with "Yes" lable on it */ const button1

CTK WARRIOR 17 May 14, 2022
A wrapper for @discordjs/voice

ezvoice A lightweight package designed to make it just a bit easier to play and record sound with @discordjs/voice Discord: nab138#2035 Examples Conne

null 0 May 19, 2022
Featureful selfbot wrapper for its Discord selfbot

Featureful Selfbot wrapper for its Discord Selfbot. This library provides non-standard stuff such farming, intervals, and respect the ratelimit.

null 5 Nov 30, 2022
spotify.ts is an wrapper built around Spotify's Web API

spotify.ts About spotify.ts is an wrapper built around Spotify's Web API. Features Fast Object Oriented Typescript, ESM, CJS support Easy to Use Insta

null 6 Nov 17, 2022
Unofficial javascript wrapper to WhatsApp Cloud API.

heyooh Unofficial javascript wrapper to WhatsApp Cloud API. Its the javascript port for heyoo Features supported Sending messages Sending Media (image

JS Hub Zimbabwe 24 Dec 30, 2022
🎸 foolproof wrapper to stream what you're currently listening to

A lightweight Spotify API wrapper that allows you to display the music you're currently listening to ?? ?? ?? Getting started ⏪ Prerequisites Create a

null 11 Dec 29, 2022
A Node JS Express/Serverless demo application that creates a slideshow video using the Pexels image library and Shotstack video editing API.

Shotstack Pexels Slideshow Video Demo This project demonstrates how to use the Shotstack cloud video editing API to create a video using an HTML form

Shotstack 25 Dec 9, 2022
Bot sviluppato in Node.js che permette la prenotazione e il successivo invio dello screenshot di quest'ultima tramite un bot di telegram.

Unimore-Bot Bot sviluppato in Node.js che permette la prenotazione e il successivo invio dello screenshot di quest'ultima tramite un bot di telegram I

Lorenzo Codeluppi 8 Jun 9, 2022
A Discord <-> Telegram bridge rewrote from scratch, in Node.js

Discord-Telegram-bridge A small and fast telegram to discord chat bridge, written in Node.js Setup: If you want to run it on heroku, you can just clic

Sebastiano Barezzi 6 Apr 14, 2022
Easy and simple twitch bot in node.js.. very very easy..

How It Works identity: { username: 'YOUR BOTS USERNAME', <-- This is where you place the username that you gave the bot account password: '

Ventispurr 3 Dec 18, 2021
This bot is a cool Discord bot made in discord.js using Node.JS

Anti-Crosspost Discord Bot This bot is a cool Discord bot made in discord.js using Node.JS. It detects when a user cross-posts a message in multiple c

Muhammad Usman Mithani 4 May 31, 2022
🤖 NODE.TS - Play a welcome sound every time someone joins the voice channel, meme bot. (Olha ele ae)

welcome2voice-bot ?? NODE.TS - Play a welcome sound every time someone joins the voice channel. ?? INVITE-ME ?? Installation Clone project git clone g

Bruno Silva 5 Feb 23, 2022
Denky is a multipurpose Discord bot, build with Node.js, TypeScript and discord.js.

?? Denky Bot Denky is a brazilian Discord bot, build with Node.js, TypeScript and discord.js. ⚙️ How to Create a Discord application. Guide Install No

Davi Patricio 8 Apr 6, 2022
A easy way for making bots using Discord.js/Node.js

Discord.js-Bot-Template This is a very simple template for making bots using Discord.js/Node.js Tutorial: To begin, Install Node.js here. After Node.J

Prosperity 4 Nov 8, 2022