Lavalink client with lots of extra functionality, easy to use and well optimized.

Overview

📘 nSysLava

Lavalink client with lots of extra functionality, easy to use and well optimized!

พัฒนาโดยคนไทย 😳

  • Many utility functions - มีฟังก์ชันอรรถประโยชน์มากมาย
  • Lightweight and high efficiency - เบาและมีประสิทธิภาพสูง

❤️ Interesting function / ฟังก์ชันที่น่าสนใจ

  • Best Reconnecting handles
  • Load Balance
  • Queue System
  • Autoplay

📌 Links

📖 Installation / วิธีการติดตั้ง

required Node.js v16+

npm i nsyslava

📘 Usage / การใช้งาน

Setup

import { Client } from 'discord.js';
import { nSysManager } from 'nsyslava';

const client = new Client({ intents: [...] });

const manager = new nSysManager([
    {
        name: 'nLavalink',
        host: 'localhost',
        port: 2333,
        secure: false,
        authorization: 'loveu3000',
        clientName: 'nSysLava',
        reconnect: {
            retryAmout: 999,
            delay: 3000,
        },
        search: true,
        play: true,
    }
])

manager.on('sendGatewayPayload', (id, payload) => {
    const guild = client.guilds.cache.get(id);
    if (guild) guild.shard.send(payload);
})

client.ws.on('VOICE_SERVER_UPDATE', upd => manager.handleVoiceUpdate(upd))
client.ws.on('VOICE_STATE_UPDATE', upd => manager.handleVoiceUpdate(upd))

client.once('ready', () => {
    console.log(`[Client] is Ready! | Login as ${client.user.tag}`)
    manager.connect(client.user.id)
})

client.login(...)

Playing music

const result = await manager.loadTracks('https://youtu.be/G0iN4jhaKqw');

if (result.loadType === 'LOAD_FAILED' || result.loadType === 'NO_MATCHES') return;

const player = manager.createPlayer(guildId);
player.connect(channelId);

player.queue.add(result.tracks);
player.queue.start();

Functions

// skip
player.queue.skip();

// previous
player.queue.toPrevious();

// remove
player.queue.remove(4);

// shuffle
player.queue.shuffle();

// loop
// 0 = none
// 1 = queue
// 2 = track
player.queue.setLoop(2);

// Autoplay
player.queue.setAutoplay(true);

// pause
player.setPause(true);

// volume
player.setVolume(100);

// seek
player.seek(37000);

// Destroy player
manager.destroy(guildId)

// Node stats
const node = manager.getNode('nLavalink');
console.log(node.stats)

// Add node
manager.addNode({ ...nodeConfig })
You might also like...

Completely free TS/JS one-file source code snippets with tests, which can be copied to avoid extra dependencies (contributions welcome).

TinySource Completely free TS/JS one-file source code snippets with tests, which can be copied to avoid extra dependencies (contributions welcome). Sn

Jan 3, 2023

Pure JS Auto Complete plugin with extra features.

Pure JS Auto Complete plugin with extra features.

Cndk.AutoComplete.js Cndk.AutoComplete.js is a pure JavaScript plugin. It performs auto-complete operations within an INPUT. Installation Include the

Jan 25, 2022

Easy and flexible jQuery tabbed functionality without all the styling.

JQuery EasyTabs Plugin Tabs with(out) style. EasyTabs creates tabs with all the functionality, no unwanted changes to your markup, and no hidden styli

Nov 23, 2022

A demonstration app for Fresh that shows how to use SSR, the islands functionality, APIs and more

Fresh Pokemon Demo Code This is a demonstration app for Fresh that shows how to use SSR, the islands functionality, APIs and more. You do need to conn

Dec 18, 2022

Interactive To Do List, draggable tasks, optimized for desktop and mobile screen sizes. It reserves data in local storage. Built with HTML, CSS, and JavaScript.

To Do List Interactive daily To-Do List Built With Major languages: html, css, javascript Frameworks: Technologies used: Webpack Live Demo Live Demo L

Aug 4, 2022

Unofficial API client for the Tidbyt API. Use this client to control Tidbyt devices and integrate with other services.

Tidbyt Client for Node.js Unofficial API client for the Tidbyt API. Use this client to control Tidbyt devices and integrate with other services. Insta

Dec 17, 2022

A fast and optimized middleware server with an absurdly small amount of code (300 lines) built on top of Deno's native HTTP APIs

A fast and optimized middleware server with an absurdly small amount of code (300 lines) built on top of Deno's native HTTP APIs with no dependencies. It also has a collection of useful middlewares: log file, serve static, CORS, session, rate limit, token, body parsers, redirect, proxy and handle upload. In "README" there are examples of all the resources. Faster's ideology is: all you need is an optimized middleware manager, all other functionality is middleware.

Dec 28, 2022

Optimized dracula theme vscode extension for flutter, web, electron and golang development.

Optimized dracula theme vscode extension for flutter, web, electron and golang development.

Optimized Dracula Theme A color theme inspired by dracula color theme. This color theme is not based on dracula color theme. The color styles are simi

Jul 11, 2022
Owner
nicenathapong
nSys Developer!
nicenathapong
VanillaSelectBox - A dropdown menu with lots of features that takes a select tag and transforms it into a single or multi-select menu with 1 or 2 levels

vanillaSelectBox v1.0.0 vanillaSelectBox : v1.00 : Adding a package.json file New : Possibility to change the dropdown tree and change the remote sear

philippe MEYER 103 Dec 16, 2022
A social network app cloned from Instagram built with Next.Js, Socket.IO and a lots of other new stuff.

Instagram Noob ⚡ A social network app cloned from Instagram built with Next.Js, Socket.IO and a lots of other new stuff. Live Demo: https://instagram-

Hung Minh 20 Oct 19, 2022
Project to manage multiple emails at once with lots of customization. You can send and receive emails. Desktop notifications can be modified.

Technologies Used React Redux Tailwind CSS Features Admin dashboard User settings and or user dashboard send emails recive emails Connections through

Multi Email 9 Dec 17, 2022
Fast Hugo gallery theme/module suitable for lots of images.

Gallery Deluxe A Hugo Module to show a photo gallery. It's very fast/effective, especially if you have lots of images on display. See the annotated in

Bjørn Erik Pedersen 51 Jan 2, 2023
This is my first website. It has helpful information, games, lots of pages & more.

Mitko.Vtori World This is my first website. It has helpful information, games, lots of pages & more. ?? Presentation & Introduction Here's link to my

Dimitar Dimitrov 29 Dec 30, 2022
Seamless and lightweight parallax scrolling library implemented in pure JavaScript utilizing Hardware acceleration for extra performance.

parallax-vanilla.js Seamless and lightweight parallax scrolling library implemented in pure JavaScript utilizing Hardware acceleration for extra perfo

Erik Engervall 91 Dec 16, 2022
Extra modifications and enhancements for Discord Bot Maker. Mods you won't find on the DBM Network!

DBM Extended is a open source project meant to enhance and extend Discord Bot Maker. Downloads This repository is not meant to be downloaded or cloned

DBM Extended 11 Oct 10, 2022
A JSX transformer with extra hints around interpolations and outer templates.

@ungap/babel-plugin-transform-hinted-jsx This plugin is a follow up of this post and it can be used together with @babel/plugin-transform-react-jsx. A

ungap 12 Nov 12, 2022
DevArms - a collection of developer utils that gives you extra arms to reach more in your tasks

DevArms is a collection of developer utils that gives you extra arms to reach more in your tasks. It runs completely offline, and cross-platform across Windows, Mac and Linux. Written in Rust, React. Powered by Tauri.

Qiushi Pan 82 Dec 18, 2022
Extended magic-string with extra utilities

DEPRECATED. It has been ported back to magic-string >= 0.26.0 magic-string-extra Extended Rich-Harris/magic-string with extra utilities. Install npm i

Anthony Fu 130 Sep 8, 2022