A lavalink track search module
npm install amagiload, 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. Handle it your own. _Better to make/modify your own plugin so the response matches Amagi's._
js
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));
}
``