2.0.7 • Published 2 years ago

nsyslava v2.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

📘 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 })
2.0.7

2 years ago

2.0.62

2 years ago

2.0.61

2 years ago

2.0.6

2 years ago

2.0.53

2 years ago

2.0.52

2 years ago

2.0.51

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.35

2 years ago

2.0.34

2 years ago

2.0.33

2 years ago

2.0.32

2 years ago

2.0.31

2 years ago

2.0.3

2 years ago

2.0.22

2 years ago

2.0.21

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.62

2 years ago

1.0.61

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago