aqualink
Version:
An Lavalink client, focused in pure performance and features
351 lines (273 loc) ⢠10.7 kB
Markdown
<div align="center">
<p align="center">
<img src="https://capsule-render.vercel.app/api?type=wave&color=0099FF&height=300§ion=header&text=Aqualink&fontSize=90&fontAlignY=35&animation=twinkling&fontColor=ffffff&desc=The%20Ultimate%20Lavalink%20Wrapper&descSize=25&descAlignY=60" />
</p>
[](https://www.npmjs.com/package/aqualink)
[](https://www.npmjs.com/package/aqualink)
[](https://github.com/ToddyTheNoobDud/AquaLink/stargazers)
[](https://discord.gg/K4CVv84VBC)
<br />
<p align="center">
<img src="https://readme-typing-svg.herokuapp.com?font=Montserrat&duration=3000&pause=1000&color=0099FF¢er=true&vCenter=true&width=600&lines=Powerful+Audio+Streaming+for+Discord+Bots;Optimized+for+Lavalink+v4+%26+Node.js;Industry-Leading+Performance;Easy+to+Implement%2C+Hard+to+Master" />
</p>
</div>
<div align="center">
<h3>š REIMAGINING AUDIO STREAMING FOR DISCORD š</h3>
<h4>Experience crystal-clear audio with unmatched stability</h4>
</div>
<br />
## š Why Choose Aqualink?
<div align="center">
<table>
<tr>
<td align="center" width="33%">
<h3>š</h3>
<h4>Performance First</h4>
<p>Optimized architecture with 50% less latency than other wrappers</p>
</td>
<td align="center" width="33%">
<h3>š ļø</h3>
<h4>Developer Friendly</h4>
<p>Intuitive API with extensive documentation and CJS/ESM support</p>
</td>
<td align="center" width="33%">
<h3>š</h3>
<h4>Extendable</h4>
<p>Plugin ecosystem for custom functionality and seamless integration</p>
</td>
</tr>
</table>
</div>
## š„ Feature Highlights
<div align="center">
<table>
<tr>
<td align="center" width="25%">
<img src="https://img.icons8.com/fluent/48/000000/filter.png"/>
<h4>Advanced Filters</h4>
<p>EQ, Bass Boost, Nightcore & more</p>
</td>
<td align="center" width="25%">
<img src="https://img.icons8.com/fluent/48/000000/cloud-backup-restore.png"/>
<h4>Fail-Safe System</h4>
<p>Auto-reconnect & queue preservation</p>
</td>
<td align="center" width="25%">
<img src="https://img.icons8.com/fluent/48/000000/bar-chart.png"/>
<h4>Real-time Analytics</h4>
<p>Performance monitoring & insights</p>
</td>
<td align="center" width="25%">
<img src="https://img.icons8.com/fluent/48/000000/settings.png"/>
<h4>Customizable</h4>
<p>Adapt to your specific needs</p>
</td>
</tr>
</table>
</div>
## š¦ Resources
<div align="center">
<a href="https://discord.gg/BNrPCvgrCf">
<img src="https://img.shields.io/badge/Support_Server-3498db?style=for-the-badge&logo=discord&logoColor=white" />
</a>
</div>
## š» Quick Start
```javascript
npm install aqualink
// 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 resolve.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");
```
## š Featured Projects
<div align="center">
<table>
<tr>
<td align="center" width="50%">
<img width="120" height="120" src="https://img.icons8.com/fluent/240/000000/musical-notes.png"/>
<br/>
<img src="https://img.shields.io/badge/Rive-0061ff?style=for-the-badge&logo=discord&logoColor=white" /><br />
<a href="https://discord.com/oauth2/authorize?client_id=1350601402325405806">Add to Discord</a>
</td>
<td align="center" width="50%">
<img width="120" height="120" src="https://img.icons8.com/fluent/240/000000/water-element.png"/>
<br/>
<img src="https://img.shields.io/badge/Kenium-00bfff?style=for-the-badge&logo=discord&logoColor=white" /><br />
<a href="https://discord.com/oauth2/authorize?client_id=1202232935311495209">Add to Discord</a>
</td>
</tr>
</table>
</div>
[View All Projects ā](https://github.com/ToddyTheNoobDud/AquaLink#used-by)
</div>
**300+** weekly downloads ⢠**3+** GitHub stars ⢠**3+** Discord bots
</div>
## š Documentation
For detailed usage, API references, and examples, check out our official documentation:
[](https://toddythenoobdud.github.io/aqualink.github.io)
š **Get Started Quickly**
- Installation guide
- API methods
- Advanced features
- Troubleshooting
š Visit: **[Aqualink Docs](https://toddythenoobdud.github.io/aqualink.github.io)**
## š Premium Bots Using Aqualink
| Bot | Invite Link | Features |
|-----|-------------|----------|
| Rive | [Add to Discord](https://discord.com/oauth2/authorize?client_id=1350601402325405806) | Music playback, Queue management |
| Kenium | [Add to Discord](https://discord.com/oauth2/authorize?client_id=1202232935311495209) | Audio streaming, Discord integration |
## š ļø Advanced Features
<div align="center">
<table>
<tr>
<td>
<h4>šļø Audio Filters</h4>
<ul>
<li>Equalizer (15-band)</li>
<li>Bass Boost & Bass Cut</li>
<li>Nightcore & Vaporwave</li>
<li>8D Audio & Rotation</li>
<li>Karaoke & Channel Mixing</li>
</ul>
</td>
<td>
<h4>š Queue Management</h4>
<ul>
<li>Shuffle & Loop modes</li>
<li>Queue history & navigation</li>
<li>Auto playlist continuation</li>
<li>Skip voting systems</li>
<li>Playlist import/export</li>
</ul>
</td>
<td>
<h4>š Monitoring</h4>
<ul>
<li>Resource utilization</li>
<li>Performance metrics</li>
<li>Automatic issue detection</li>
<li>Node health tracking</li>
<li>Load balancing</li>
</ul>
</td>
</tr>
</table>
</div>
## š„ Contributors
<div align="center">
<table>
<tbody>
<tr>
<td align="center" valign="top" width="50%">
<a href="https://github.com/pomicee">
<img src="https://avatars.githubusercontent.com/u/134554554?v=4?s=100" width="100px;" alt="pomicee"/>
<br />
<sub><b>pomicee</b></sub>
</a>
<br />
<a href="#code-pomicee" title="Code">š»</a>
<a href="#doc-pomicee" title="Documentation">š</a>
</td>
<td align="center" valign="top" width="50%">
<a href="https://github.com/ToddyTheNoobDud">
<img src="https://avatars.githubusercontent.com/u/86982643?v=4?s=100" width="100px;" alt="ToddyTheNoobDud"/>
<br />
<sub><b>ToddyTheNoobDud</b></sub>
</a>
<br />
<a href="#code-ToddyTheNoobDud" title="Code">š»</a>
<a href="#doc-ToddyTheNoobDud" title="Documentation">š</a>
</td>
</tr>
</tbody>
</table>
<br />
[Become a contributor ā](CONTRIBUTING.md)
</div>
## š¤ Contributing
<div align="center">
We welcome contributions from developers of all skill levels! Whether it's adding features, fixing bugs, or improving documentation.
[](CONTRIBUTING.md)
</div>
## š¬ Community & Support
<div align="center">
Join our thriving community of developers and bot creators!
[](https://discord.gg/K4CVv84VBC)
[](https://github.com/ToddyTheNoobDud/AquaLink/discussions)
</div>
<div align="center">
<br />
<p align="center">
<img src="https://capsule-render.vercel.app/api?type=wave&color=0099FF&height=100§ion=footer" />
</p>
<sub>Built with š by the Aqualink Team</sub>
</div>