catto.js 0.7.5 → 0.7.7

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.
Files changed (2) hide show
  1. package/Bot.js +13 -3
  2. package/package.json +1 -1
package/Bot.js CHANGED
@@ -151,9 +151,19 @@ module.exports = class extends EventEmitter {
151
151
  break;
152
152
  }
153
153
  }
154
+ var integration_types = [0];
155
+ if (cmd.user) {
156
+ integration_types.push(1);
157
+ }
158
+ var contexts = [0];
159
+ if (cmd.dm) {
160
+ contexts.push(1);
161
+ }
162
+ if (cmd.user) {
163
+ contexts.push(2);
164
+ }
154
165
  cmds.push(Object.assign(cmdo.toJSON(), {
155
- "integration_types": [0, 1].slice(0, (cmd.user ? 2 : 1)),
156
- "contexts": [0, 1, 2].slice(0, (cmd.user ? 3 : 2)),
166
+ integration_types, contexts
157
167
  }));
158
168
  }
159
169
  for (var cmd of this.userContexts.values()) {
@@ -178,7 +188,7 @@ module.exports = class extends EventEmitter {
178
188
  });
179
189
  }
180
190
  this.emit("running", { Discord });
181
- if (this.cluster.id == (this.cluster.count - 1)) {
191
+ if (this.cluster && this.cluster.id == (this.cluster.count - 1)) {
182
192
  this.cluster.broadcastEval(client => client.emit("_runningFull"));
183
193
  this.emit("runningFullLast", { Discord });
184
194
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catto.js",
3
- "version": "0.7.5",
3
+ "version": "0.7.7",
4
4
  "description": "Universal module for everything.",
5
5
  "main": "index.js",
6
6
  "scripts": {