catto.js 1.0.2 → 1.0.4
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/AuthClient.js +4 -4
- package/MessageBuilder.js +7 -0
- package/Server.js +0 -1
- package/User.js +1 -4
- package/activity-sdk.js +9795 -0
- package/package.json +1 -1
package/AuthClient.js
CHANGED
|
@@ -56,7 +56,7 @@ module.exports = class {
|
|
|
56
56
|
} catch(e) {
|
|
57
57
|
return !1;
|
|
58
58
|
}
|
|
59
|
-
if (result.response.
|
|
59
|
+
if (result.response.status == 200) {
|
|
60
60
|
this.writeToken(result.body);
|
|
61
61
|
return !0;
|
|
62
62
|
} else {
|
|
@@ -83,7 +83,7 @@ module.exports = class {
|
|
|
83
83
|
} catch(e) {
|
|
84
84
|
return !1;
|
|
85
85
|
}
|
|
86
|
-
if (result.response.
|
|
86
|
+
if (result.response.status == 200) {
|
|
87
87
|
this.writeToken(result.body);
|
|
88
88
|
return !0;
|
|
89
89
|
} else {
|
|
@@ -109,7 +109,7 @@ module.exports = class {
|
|
|
109
109
|
} catch(e) {
|
|
110
110
|
return !1;
|
|
111
111
|
}
|
|
112
|
-
if (result.response.
|
|
112
|
+
if (result.response.status == 200) {
|
|
113
113
|
this.options.accessToken = "";
|
|
114
114
|
this.options.refreshToken = "";
|
|
115
115
|
return !0;
|
|
@@ -131,7 +131,7 @@ module.exports = class {
|
|
|
131
131
|
} catch(e) {
|
|
132
132
|
return !1;
|
|
133
133
|
}
|
|
134
|
-
if (result.response.
|
|
134
|
+
if (result.response.status == 200) {
|
|
135
135
|
this.user = new User(result.body);
|
|
136
136
|
return !0;
|
|
137
137
|
} else {
|
package/MessageBuilder.js
CHANGED
|
@@ -131,5 +131,12 @@ class MessageBuilder {
|
|
|
131
131
|
throw new Error("Message can't have more than 10 embeds.");
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
+
file(d) {
|
|
135
|
+
if (!this.data.files) {
|
|
136
|
+
this.data.files = [];
|
|
137
|
+
}
|
|
138
|
+
this.data.files.push(d);
|
|
139
|
+
return this;
|
|
140
|
+
}
|
|
134
141
|
}
|
|
135
142
|
module.exports = MessageBuilder;
|
package/Server.js
CHANGED
package/User.js
CHANGED
|
@@ -241,10 +241,7 @@ module.exports = class {
|
|
|
241
241
|
async requestApplication() {
|
|
242
242
|
if (this.isBot) {
|
|
243
243
|
this.application = new Application((await request.get({
|
|
244
|
-
"url": `https://discord.com/api/v${(this.bot ? (this.bot.client.rest.version ? this.bot.client.rest.version.toString() : "10") : "10")}/oauth2/applications/${this.id}/rpc
|
|
245
|
-
"headers": {
|
|
246
|
-
"Authorization": `Bot ${this.bot.client.token}`
|
|
247
|
-
}
|
|
244
|
+
"url": `https://discord.com/api/v${(this.bot ? (this.bot.client.rest.version ? this.bot.client.rest.version.toString() : "10") : "10")}/oauth2/applications/${this.id}/rpc`
|
|
248
245
|
})).body);
|
|
249
246
|
}
|
|
250
247
|
}
|