npm

amagi
TypeScript icon, indicating that this package has built-in type declarations

1.2.4 • Public • Published

Amagi

A lavalink search wrapper with ratelimit protection. Fully customizable

Take note this module only handles search, not playing music, thus it's customizable.

Amagi

Amagi © Azur Lane

Features

Hmm not much tbh
✓ Easy to use
✓ Pretty stable
✓ Author is responsible with bugs*
✓ Cache support**
✓ Customizable***
✓ Auto-disable rate limited node and use another
✓ Anime character 💖💖💖💖

Documentation

Pls read me

Installation

npm i amagi

Plugins

You can use mostly any plugins with load, unload, and with some binds inside it. Tested with erela.js's and kazagumo's plugin. Because this module's plugin is universal, of course the result will not be the same as Amagi's Promise<SearchResult>. Handle it your own. Better to make/modify your own plugin so the response matches Amagi's.

Why this module

I want to make a different manager for lavalink search so my main lavalink player is not disturbed. Best for massive search, you can add unlimited nodes except your node to prevent 429!

Example

const { Amagi } = require('../');

const NODES = [{
    host: 'you.weeb:443',
    auth: 'weebMaster',
    secure: true,
    identifier: 'NODE-WEEB-01'
}, {
    host: 'me.weeb:8080',
    auth: 'weebSenpai',
    identifier: 'NODE-WEEB-02'
}]

const amagi = new Amagi(NODES, {
    cache: {
        enabled: true,
        type: 'memory'
    },
    modifyTracks: (track) => ({ track: track.track, title: track.info.title })
}); // see all available options here https://takiyo0.github.io/Amagi/interfaces/Index.AmagiOptions.html

// Scientific purpose
amagi.on('debug', console.log);
amagi.on('request', console.log);

// Init the module first
amagi.init().then(run);

function run() {
    amagi.search('wonder caravan', { engine: 'youtubeMusic' }).then(r => console.log(r)).catch(e => console.log(e));
}

Notes

*= Depend on the author's availability
**= Only works for non-plugin result
***= Track is customizable, plugins can customize the module

Package Sidebar

Install

npm i amagi

Weekly Downloads

1

Version

1.2.4

License

ISC

Unpacked Size

27 kB

Total Files

12

Last publish

Collaborators

  • takiyo