mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
rewrite ratelimiting and api route builder (#1667)
* rewrite ratelimiting and api route builder * more stuff * let people pass their own handlers * Update burst.js * Update RequestHandler.js * Update burst.js * Update sequential.js * Update RequestHandler.js
This commit is contained in:
@@ -153,7 +153,7 @@ class Webhook {
|
||||
file.file = buffer;
|
||||
return file;
|
||||
})
|
||||
)).then(files => this.client.api.webhooks.opts(this.id, this.token).post({
|
||||
)).then(files => this.client.api.webhooks(this.id, this.token).post({
|
||||
data: options,
|
||||
query: { wait: true },
|
||||
files,
|
||||
@@ -161,7 +161,7 @@ class Webhook {
|
||||
}));
|
||||
}
|
||||
|
||||
return this.client.api.webhooks.opts(this.id, this.token).post({
|
||||
return this.client.api.webhooks(this.id, this.token).post({
|
||||
data: options,
|
||||
query: { wait: true },
|
||||
auth: false,
|
||||
@@ -190,7 +190,7 @@ class Webhook {
|
||||
* }).catch(console.error);
|
||||
*/
|
||||
sendSlackMessage(body) {
|
||||
return this.client.api.webhooks.opts(this.id, this.token).slack.post({
|
||||
return this.client.api.webhooks(this.id, this.token).slack.post({
|
||||
query: { wait: true },
|
||||
auth: false,
|
||||
data: body,
|
||||
@@ -216,7 +216,7 @@ class Webhook {
|
||||
return this.edit({ name, avatar: dataURI }, reason);
|
||||
});
|
||||
}
|
||||
return this.client.api.webhooks.opts(this.id, this.token).patch({
|
||||
return this.client.api.webhooks(this.id, this.token).patch({
|
||||
data: { name, avatar },
|
||||
reason,
|
||||
}).then(data => {
|
||||
@@ -232,7 +232,7 @@ class Webhook {
|
||||
* @returns {Promise}
|
||||
*/
|
||||
delete(reason) {
|
||||
return this.client.api.webhooks.opts(this.id, this.token).delete({ reason });
|
||||
return this.client.api.webhooks(this.id, this.token).delete({ reason });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user