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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poru",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "A stable and powefull lavalink client with so many features",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  class Track {
2
2
  constructor(data) {
3
- this.track = data.info.track
4
- this.info ={
3
+ this.track = data.track
4
+ this.info = {
5
5
  identifier : data.info.identifier,
6
6
  isSeekable : data.info.isSeekable,
7
7
  author : data.info.author,
@@ -1,5 +1,3 @@
1
- import { EventEmitter } from "ws";
2
-
3
1
  declare module'Poru' {
4
2
 
5
3
  import { EventEmitter } from 'events';