2.3.0 • Published 6 months ago

aqualink v2.3.0

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

AquaLink

An Stable, performant, Recourse friendly and fast lavalink wrapper

This code is based in riffy, but its an 100% Rewrite made from scratch...

Why use AquaLink

  • Only uses 1 dependecy (ws for websocket, atm)
  • HTTP1.1 / HTTP2 Support
  • Very Low memory comsuption
  • Built in Queue manager
  • Lots of features to use
  • Lowest CPU Usage
  • Very fast (mine take less than 1 second to load an song!)
  • 1 Player created = ~1 - 0,5 mb per player
  • Auto clean Up memory when song finishes / bot leave the vc (Now Options supported!)
  • Plugin system
  • Lavalink v4.0.8 | v4.1.0 Support (Nodelink works, but only with play etc, more support soon)
  • Youtube and Spotify support (Soundcloud, deezer, vimeo, etc also works...)
  • Minimal Requests to the lavalink server (helps the lavalink recourses!)
  • Playlist support (My mix playlists, youtube playlists, spotify playlists, etc)
  • Lyrics Support by Lavalink

Tralalero Tralala 2.3.0 Released


  • now is ~21% more lightweight, reduced disk space

  • Improved the AQUA module

    • 3x better cleanup system
    • Fixed some memory leaks
    • Improved long process support
    • Faster node caching
  • Remade the Player module

    • Added circular buffer for previousTracks (way more memory efficient)
    • Reorganized the event handlings
    • Way better Memory management
  • Rewrite the Node system

    • Fixed an memory leak in connections
    • Improved the overal speed
    • Improved code readbility / modules
    • improved cleanup System
    • Better long runtime
    • Rewrite the Filter system
  • Improved Rest code

    • Fixed lyrics (both search and get)
    • Better chunks system for more performance
  • Improved fetchImage speed and recourses

Docs (Wiki)

How to install

npm install aqualink

pnpm install aqualink

Basic usage

// If you're using Module, use this:
// import { createRequire } from 'module';
// const require = createRequire(import.meta.url);

//const { Aqua } = require('aqualink');



const { Aqua } = require("aqualink");
const { Client, Collection, GatewayDispatchEvents } = require("discord.js");

const client = new Client({
    intents: [
        "Guilds",
        "GuildMembers",
        "GuildMessages",
        "MessageContent",
        "GuildVoiceStates"
    ]
});

const nodes = [
    {
        host: "127.0.0.1",
        password: "yourpass",
        port: 233,
        secure: false,
        name: "localhost"
    }
];

const aqua = Aqua(client, nodes, {
  defaultSearchPlatform: "ytsearch",
  restVersion: "v4",
  autoResume: false,
  infiniteReconnects: true,
});

client.aqua = aqua;


client.once("ready", () => {
    client.aqua.init(client.user.id);
    console.log("Ready!");
});


client.on("raw", (d) => {
    if (![GatewayDispatchEvents.VoiceStateUpdate, GatewayDispatchEvents.VoiceServerUpdate,].includes(d.t)) return;
    client.aqua.updateVoiceState(d);
});

client.on("messageCreate", async (message) => {
    if (message.author.bot) return;

    if (!message.content.startsWith("!play")) return;

    const query = message.content.slice(6);

    const player = client.aqua.createConnection({
        guildId: message.guild.id,
        voiceChannel: message.member.voice.channel.id,
        textChannel: message.channel.id,
        deaf: true,
    });

    const resolve = await client.aqua.resolve({ query, requester: message.member });

    if (resolve.loadType === 'playlist') {
        await message.channel.send(`Added ${resolve.tracks.length} songs from ${resolve.playlistInfo.name} playlist.`);
        for (const track of result.tracks) {
          player.queue.add(track);
        }
        if (!player.playing && !player.paused) return player.play();

    } else if (resolve.loadType === 'search' || resolve.loadType === 'track') {
        const track = resolve.tracks.shift();
        track.info.requester = message.member;

        player.queue.add(track);

        await message.channel.send(`Added **${track.info.title}** to the queue.`);

        if (!player.playing && !player.paused) return player.play();

    } else {
        return message.channel.send(`There were no results found for your query.`);
    }
});

client.aqua.on("nodeConnect", (node) => {
    console.log(`Node connected: ${node.name}`);
});
client.aqua.on("nodeError", (node, error) => {
    console.log(`Node "${node.name}" encountered an error: ${error.message}.`);
});

client.login("Yourtokenhere");
2.3.0

6 months ago

2.2.0

6 months ago

2.1.3

7 months ago

2.1.2

7 months ago

2.1.1

7 months ago

2.0.2

7 months ago

1.9.1-beta1

7 months ago

2.1.0

7 months ago

2.0.1

7 months ago

2.0.0

7 months ago

1.9.0-fix

7 months ago

2.0.0-fix

7 months ago

1.9.0-beta2

7 months ago

1.9.0

7 months ago

1.8.1-beta4

7 months ago

1.8.1-beta5

7 months ago

1.8.1-beta2

7 months ago

1.8.1-beta1

7 months ago

1.8.1-beta3

7 months ago

1.8.0

8 months ago

1.7.0-beta6

8 months ago

1.7.0-beta5

8 months ago

1.7.0-beta4

8 months ago

1.7.0-beta3

8 months ago

1.7.0-beta2

9 months ago

1.7.0-beta1

9 months ago

1.6.2-beta

9 months ago

1.6.2-beta2

9 months ago

1.6.1-beta

9 months ago

1.6.0

9 months ago

1.5.2-beta

9 months ago

1.5.1

9 months ago

1.5.0

9 months ago

1.4.2

9 months ago

1.4.1

9 months ago

1.4.0

9 months ago

1.2.0

10 months ago

1.3.0

10 months ago

1.1.0

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago