Table of Contents
yarn add @skyra/audio
# or npm install @skyra/audio
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
Copyright © 2020, Skyra Project. Released under the MIT License.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
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 | ![PatreonImage][] | Click Here |
PayPal | ![PayPalImage][] | Click Here |
BitCoin | ![BitcoinImage][] | 3JNzCHMTFtxYFWBnVtDM9Tt34zFbKvdwco |
Ethereum | ![EthereumImage][] | 0xcB5EDB76Bc9E389514F905D9680589004C00190c |
Litecoin | ![LitecoinImage][] | MNVT1keYGMfGp7vWmcYjCS8ntU8LNvjnqM |
Thanks goes to these wonderful people (emoji key):
Antonio Román 💻 ⚠️ 🤔 🚇 |
Jeroen Claassens 💻 🚇 🚧 |
This project follows the all-contributors specification. Contributions of any kind welcome!
Generated using TypeDoc