Package Exports
- aqualink
Readme
๐ REIMAGINING AUDIO STREAMING FOR DISCORD ๐
Experience crystal-clear audio with unmatched stability
๐ Why Choose Aqualink?
๐Performance FirstOptimized architecture with 50% less latency than other wrappers |
๐ ๏ธDeveloper FriendlyIntuitive API with extensive documentation and CJS/ESM support |
๐ExtendablePlugin ecosystem for custom functionality and seamless integration |
๐ฆ Installation
Latest Stable Release: v2.13.0 โข Choose your preferred package manager below
๐ฆ NPM (Most Popular)
# ๐ฏ Stable release (recommended for production)
npm install aqualink
# ๐ง Latest development build
npm install ToddyTheNoobDud/aqualink๐งถ Yarn (Fast & Reliable)
# ๐ฏ Stable release (recommended for production)
yarn add aqualink
# ๐ง Latest development build
yarn add ToddyTheNoobDud/aqualinkโก Bun (Lightning Fast)
# ๐ฏ Stable release (recommended for production)
bun add aqualink
# ๐ง Latest development build
bun add ToddyTheNoobDud/aqualink๐ฆ pnpm (Space Efficient)
# ๐ฏ Stable release (recommended for production)
pnpm add aqualink
# ๐ง Latest development build
pnpm add ToddyTheNoobDud/aqualink๐ฅ Feature Highlights
Advanced FiltersEQ, Bass Boost, Nightcore & more |
Fail-Safe SystemAuto-reconnect & queue preservation |
Real-time AnalyticsPerformance monitoring & insights |
CustomizableAdapt to your specific needs |
๐ฆ Resources
๐ป Quick Start
npm install aqualink discord.jsconst { Aqua } = require("aqualink");
const { Client, GatewayIntentBits, Events } = require("discord.js");
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildVoiceStates
]
});
const nodes = [
{
host: "127.0.0.1",
password: "your_password",
port: 2333,
ssl: false,
name: "main-node"
}
];
const aqua = new Aqua(client, nodes, {
defaultSearchPlatform: "ytsearch",
restVersion: "v4",
autoResume: true,
infiniteReconnects: true,
loadBalancer: 'LeastLoad',
leaveOnEnd: false
});
client.aqua = aqua;
client.once(Events.Ready, () => {
client.aqua.init(client.user.id);
console.log(`Logged in as ${client.user.tag}`);
});
client.on(Events.Raw, (d) => {
if (![Events.VoiceStateUpdate, Events.VoiceServerUpdate].includes(d.t)) return;
client.aqua.updateVoiceState(d);
});
client.on(Events.MessageCreate, async (message) => {
if (message.author.bot || !message.content.startsWith("!play")) return;
const query = message.content.slice(6).trim();
if (!query) return message.channel.send("Please provide a song to play.");
// Check if user is in a voice channel
if (!message.member.voice.channel) {
return message.channel.send("You need to be in a voice channel to play music!");
}
const player = client.aqua.createConnection({
guildId: message.guild.id,
voiceChannel: message.member.voice.channel.id,
textChannel: message.channel.id,
deaf: true,
});
try {
const resolve = await client.aqua.resolve({ query, requester: message.member });
const { loadType, tracks, playlistInfo } = resolve;
if (loadType === 'playlist') {
for (const track of tracks) {
player.queue.add(track);
}
message.channel.send(`Added ${tracks.length} songs from ${playlistInfo.name}.`);
} else if (loadType === 'search' || loadType === 'track') {
const track = tracks[0];
player.queue.add(track);
message.channel.send(`Added **${track.title}** to the queue.`);
} else {
return message.channel.send("No results found.");
}
if (!player.playing && !player.paused) {
player.play();
}
} catch (error) {
console.error("Playback error:", error);
message.channel.send("An error occurred while trying to play the song.");
}
});
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.aqua.on('trackStart', (player, track) => {
const channel = client.channels.cache.get(player.textChannel);
if (channel) channel.send(`Now playing: **${track.title}**`);
});
client.aqua.on('queueEnd', (player) => {
const channel = client.channels.cache.get(player.textChannel);
if (channel) channel.send('The queue has ended.');
player.destroy();
});
client.login("YOUR_DISCORD_BOT_TOKEN");Additional Commands You Can Add:
client.on(Events.MessageCreate, async (message) => {
if (message.content === "!skip") {
const player = client.aqua.players.get(message.guild.id);
if (player) {
player.skip();
message.channel.send("โญ๏ธ Skipped current track!");
}
}
});
client.on(Events.MessageCreate, async (message) => {
if (message.content === "!stop") {
const player = client.aqua.players.get(message.guild.id);
if (player) {
player.destroy();
message.channel.send("โน๏ธ Stopped playback and cleared queue!");
}
}
});๐ Featured Projects
300+ weekly downloads โข 3+ GitHub stars โข 3+ Discord bots
๐ Documentation
For detailed usage, API references, and examples, check out our official documentation:
๐ Get Started Quickly
- Installation guide
- API methods
- Advanced features
- Troubleshooting
๐ Visit: Aqualink Docs
๐ Premium Bots Using Aqualink
| Bot | Invite Link | Features |
|---|---|---|
| Kenium | Add to Discord | Audio streaming, Discord integration |
| Soya Music | Add to Discord | Audio streaming, Discord integration |
๐ ๏ธ Advanced Features
๐๏ธ Audio Filters
|
๐ Queue Management
|
๐ Monitoring
|
๐ฅ Contributors
๐ค Contributing
We welcome contributions from developers of all skill levels! Whether it's adding features, fixing bugs, or improving documentation.
๐ฌ Community & Support
Built with ๐ by the Aqualink Team