JSPM

@evolvejs/evolava

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q19498F
  • License AGPL-3.0-or-later

a lavalink client for evolvejs

Package Exports

  • @evolvejs/evolava

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@evolvejs/evolava) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

EvoLava

  • A simple Lavalink Client for EvolveJS

Setup

  • First of all you need to have NodeJS and EvolveJS installed...

  • Second you need to install Java (Note - You should install Java 13 as Lavalink has some problems with Java 11 and 14)

  • Download and install the latest version of Lavalink

Installation

npm i @evolvejs/evolava

Basic Startup

  • After you followed all the steps above, you can now initialize a new EvoLavaClient instance ONLY in Ready Event
  • Start the Lavalink CI server by the command java -jar Lavalink.jar in the directory where you installed lavalink, make sure to have a application.yml

Usage

const { EvoLavaClient } = require("@evolvejs/evolava");
const { EvolveBuilder, CacheOptions, GatewayIntent } = require("@evolvejs/evolvejs");

const client = new EvolveBuilder()
                    .setToken("")
                    .setShards(1)
                    .enableCache(CacheOptions.GUILD)
                    .enableIntents(
                        GatewayIntent.GUILD, GatewayIntent.GUILD_MESSAGES, GatewayIntent.VOICE_STATES
                        ).build();

client.on("clientReady", () => {
    client.music = new EvoLavaClient(client, [
        {
            host: "localhost",
            port: 2333,
            password: "youshallnotpass"
        }
        ]);
});

client.on("newMessage", (msg) => {
    if(msg.content == "play") {
        let player = client.music.spawn({
            guild: msg.guild,
            voiceChannel: msg.member.voiceState.channel,
            textChannel: msg.channel,
            volume: 100,
            self: {
                mute: false,
                deaf: true
            }
        }, {
            repeatTrack: false,
            repeatQueue: false,
            skipOnError: true
        });

        let song = player.search("Rick Astley - Never Gonna Give you up", msg.member, options: {
            source: "yt",
            add: false
        });

        if(!song) return;

        player.play();
    }
})

Support

Credits

  • Most of the logic of code was taken from LavaJS by the Projects.Me Team