Audio
A JavaScript wrapper for the Lavalink audio client for Discord. Only supports Lavalink v3.
Install / Use
/learn @skyra-project/AudioREADME
@skyra/audio
Table of Contents
About
- A JavaScript wrapper for the Lavalink audio client for Discord. Only supports Lavalink v3.
- This is a derivative work of lavalink.js, this wouldn't be possible without the author's work.
Installation and Usage
Package managers
yarn add @skyra/audio
# or npm install @skyra/audio
Usage
const { Node } = require('@skyra/audio');
const node = new Node(
{
// Your Lavalink password:
password: '',
// The user ID of your bot:
userID: '',
// The total number of shards that your bot is running (optional, useful if you're load balancing):
shardCount: 0,
// A URL to your lavalink instance without protocol (optional, can be used instead of specifying hosts option):
host: '',
// Alternatively, define a custom rest and ws host links:
hosts: {
// The http host of your lavalink instance (optional):
rest: '',
// The ws host of your lavalink instance (optional):
ws: ''
}
},
(guildID, packet) => {
const guild = client.guilds.cache.get(guildID);
if (guild) return guild.shard.send(packet);
}
);
await node.connect();
// This sends the required raw Voice State and Voice Server data to lavalink so it can make a connection.
client.ws.on('VOICE_STATE_UPDATE', async (data) => {
try {
await node.voiceStateUpdate(data);
} catch (error) {
console.error(error);
}
});
client.ws.on('VOICE_SERVER_UPDATE', async (data) => {
try {
await node.voiceServerUpdate(data);
} catch (error) {
console.error(error);
}
});
import { Node } from '@skyra/audio';
// Same as before
Meta
License
Copyright © 2020, Skyra Project. Released under the MIT License.
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request!
Buy us some doughnuts
Skyra Project is open source and always will be, even if we don't get donations. That said, we know there are amazing people who may still want to donate just to show their appreciation. Thanks you very much in advance!
We accept donations through Patreon, BitCoin, Ethereum, and Litecoin. You can use the buttons below to donate through your method of choice.
| Donate With | QR | Address |
| :---------: | :----------------: | :---------------------------------------------------------------------------------------------------------------------------------------: |
| Patreon |
| Click Here |
| PayPal |
| Click Here |
| BitCoin |
| 3JNzCHMTFtxYFWBnVtDM9Tt34zFbKvdwco |
| Ethereum |
| 0xcB5EDB76Bc9E389514F905D9680589004C00190c |
| Litecoin |
| MNVT1keYGMfGp7vWmcYjCS8ntU8LNvjnqM |
Contributors ✨
Thanks goes to these wonderful people (emoji key):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore-start --> <!-- markdownlint-disable --> <table> <tr> <td align="center"><a href="https://github.com/kyranet"><img src="https://avatars0.githubusercontent.com/u/24852502?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Antonio Román</b></sub></a><br /><a href="https://github.com/skyra-project/audio/commits?author=kyranet" title="Code">💻</a> <a href="https://github.com/skyra-project/audio/commits?author=kyranet" title="Tests">⚠️</a> <a href="#ideas-kyranet" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-kyranet" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td> <td align="center"><a href="https://favware.tech/"><img src="https://avatars3.githubusercontent.com/u/4019718?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jeroen Claassens</b></sub></a><br /><a href="https://github.com/skyra-project/audio/commits?author=Favna" title="Code">💻</a> <a href="#infra-Favna" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-Favna" title="Maintenance">🚧</a></td> </tr> </table> <!-- markdownlint-restore --> <!-- prettier-ignore-end --> <!-- ALL-CONTRIBUTORS-LIST:END -->This project follows the all-contributors specification. Contributions of any kind welcome!
Related Skills
openhue
344.4kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
344.4kElevenLabs text-to-speech with mac-style say UX.
weather
344.4kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.5kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
