catto.js 0.1.0 → 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.
- package/Bot.js +6 -0
- package/User.js +2 -1
- package/package.json +1 -1
package/Bot.js
CHANGED
|
@@ -23,6 +23,7 @@ module.exports = class extends EventEmitter {
|
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
+
this.slashCommands = new Map();
|
|
26
27
|
this.commands = new Map();
|
|
27
28
|
this.client.on("ready", () => {
|
|
28
29
|
var cmds = [];
|
|
@@ -185,6 +186,11 @@ module.exports = class extends EventEmitter {
|
|
|
185
186
|
return this;
|
|
186
187
|
}
|
|
187
188
|
command(basic, executor) {
|
|
189
|
+
if (typeof basic === "string") {
|
|
190
|
+
basic = {
|
|
191
|
+
"name": basic
|
|
192
|
+
};
|
|
193
|
+
}
|
|
188
194
|
this.commands.set(basic.name, Object.assign(basic, {
|
|
189
195
|
"execute": executor
|
|
190
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
|
}
|