hackchat-engine 1.1.23 → 1.1.25

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/Client.js CHANGED
@@ -138,9 +138,10 @@ class Client extends EventEmitter {
138
138
  * @param {string} name Name to join with
139
139
  * @param {string} password Optional password to create trip code
140
140
  * @param {string} channel Channel to join
141
+ * @param {string|boolean} color Optional hex color for initial join
141
142
  * @returns {void}
142
143
  */
143
- join(name = false, password = '', channel = false) {
144
+ join(name = false, password = '', channel = false, color = false) {
144
145
  try {
145
146
  if (!name || typeof name !== 'string') {
146
147
  throw new Error(Errors.INVALID_NAME);
@@ -150,12 +151,18 @@ class Client extends EventEmitter {
150
151
  throw new Error(Errors.INVALID_CHANNEL);
151
152
  }
152
153
 
153
- this.ws.send({
154
+ const payload = {
154
155
  cmd: OPCodes.JOIN,
155
156
  nick: name,
156
157
  pass: password,
157
158
  channel,
158
- });
159
+ };
160
+
161
+ if (color) {
162
+ payload.color = color;
163
+ }
164
+
165
+ this.ws.send(payload);
159
166
  } catch (e) {
160
167
  this.destroy();
161
168
  this.emit(Events.ERROR, `[client] Error joining channel: ${e}`);
package/package.json CHANGED
@@ -59,5 +59,5 @@
59
59
  "lintfix": "eslint --fix --ignore-path .gitignore .",
60
60
  "test": "echo \"Error: no test specified\" && exit 1"
61
61
  },
62
- "version": "1.1.23"
62
+ "version": "1.1.25"
63
63
  }
@@ -30,6 +30,18 @@ class Information {
30
30
  * @type {string}
31
31
  */
32
32
  this.channel = data.channel;
33
+
34
+ /**
35
+ * Numeric reason for the info
36
+ * @type {number}
37
+ */
38
+ this.id = data.id || 0;
39
+
40
+ /**
41
+ * The translation arguments
42
+ * @type {string}
43
+ */
44
+ this.args = data.args || {};
33
45
  }
34
46
  }
35
47
 
@@ -41,6 +41,12 @@ class WarningStruct {
41
41
  * @type {string}
42
42
  */
43
43
  this.channel = data.channel;
44
+
45
+ /**
46
+ * The translation arguments
47
+ * @type {string}
48
+ */
49
+ this.args = data.args || {};
44
50
  }
45
51
  }
46
52