poru 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/package.json +1 -1
- package/src/guild/Track.js +2 -2
- package/typings/index.d.ts +0 -2
package/README.md
CHANGED
|
@@ -53,8 +53,10 @@ To use you need a configured [Lavalink](https://github.com/Frederikam/Lavalink)
|
|
|
53
53
|
const { Client } = require("discord.js");
|
|
54
54
|
const { Poru } = require("poru");
|
|
55
55
|
|
|
56
|
+
// Initiate both main classes
|
|
56
57
|
const client = new Client();
|
|
57
58
|
|
|
59
|
+
// Define some options for the node
|
|
58
60
|
const nodes = [
|
|
59
61
|
{
|
|
60
62
|
host: "localhost",
|
|
@@ -72,6 +74,10 @@ client.poru.on("nodeConnect", node => {
|
|
|
72
74
|
console.log(`Node "${node.name}" connected.`)
|
|
73
75
|
})
|
|
74
76
|
|
|
77
|
+
// Emitted whenever a node encountered an error
|
|
78
|
+
client.poru.on("nodeError", (node, error) => {
|
|
79
|
+
console.log(`Node "${node.name}" encountered an error`)
|
|
80
|
+
})
|
|
75
81
|
|
|
76
82
|
// Listen for when the client becomes ready
|
|
77
83
|
client.once("ready", () => {
|
|
@@ -79,6 +85,9 @@ client.once("ready", () => {
|
|
|
79
85
|
console.log(`Logged in as ${client.user.tag}`);
|
|
80
86
|
});
|
|
81
87
|
|
|
88
|
+
// this event used to make connections upto date with lavalink
|
|
89
|
+
client.on("raw",async d => await client.poru.packetUpdate(d));
|
|
90
|
+
|
|
82
91
|
// Finally login at the END of your code
|
|
83
92
|
client.login("your bot token here");
|
|
84
93
|
|
package/package.json
CHANGED
package/src/guild/Track.js
CHANGED