catto.js 0.1.1 → 0.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.
Files changed (3) hide show
  1. package/Bot.js +5 -0
  2. package/User.js +2 -1
  3. package/package.json +1 -1
package/Bot.js CHANGED
@@ -186,6 +186,11 @@ module.exports = class extends EventEmitter {
186
186
  return this;
187
187
  }
188
188
  command(basic, executor) {
189
+ if (typeof basic === "string") {
190
+ basic = {
191
+ "name": basic
192
+ };
193
+ }
189
194
  this.commands.set(basic.name, Object.assign(basic, {
190
195
  "execute": executor
191
196
  }));
package/User.js CHANGED
@@ -1,3 +1,4 @@
1
+ var request = require("./request");
1
2
  var Application = require("./Application");
2
3
  module.exports = class {
3
4
  constructor(options) {
@@ -22,7 +23,7 @@ module.exports = class {
22
23
  }, options || {});
23
24
  if (this.isBot) {
24
25
  request.get(`https://discord.com/api/v${this.options.client.rest.version}/oauth2/applications/${this.id}/rpc`).then(application => {
25
- this.application = new Application(application);
26
+ this.application = new Application(application.body);
26
27
  });
27
28
  }
28
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catto.js",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Universal module for everything.",
5
5
  "main": "index.js",
6
6
  "scripts": {