mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
REST API speed improvement (#1577)
This commit is contained in:
@@ -150,7 +150,7 @@ class Webhook {
|
||||
file.file = buffer;
|
||||
return file;
|
||||
})
|
||||
)).then(files => this.client.api.webhooks(this.id, this.token).post({
|
||||
)).then(files => this.client.api.webhooks.opts(this.id, this.token).post({
|
||||
data: options,
|
||||
query: { wait: true },
|
||||
files,
|
||||
@@ -158,7 +158,7 @@ class Webhook {
|
||||
}));
|
||||
}
|
||||
|
||||
return this.client.api.webhooks(this.id, this.token).post({
|
||||
return this.client.api.webhooks.opts(this.id, this.token).post({
|
||||
data: options,
|
||||
query: { wait: true },
|
||||
auth: false,
|
||||
@@ -187,7 +187,7 @@ class Webhook {
|
||||
* }).catch(console.error);
|
||||
*/
|
||||
sendSlackMessage(body) {
|
||||
return this.client.api.webhooks(this.id, this.token).slack.post({
|
||||
return this.client.api.webhooks.opts(this.id, this.token).slack.post({
|
||||
query: { wait: true },
|
||||
auth: false,
|
||||
data: body,
|
||||
@@ -213,7 +213,7 @@ class Webhook {
|
||||
return this.edit({ name, avatar: dataURI }, reason);
|
||||
});
|
||||
}
|
||||
return this.client.api.webhooks(this.id, this.token).patch({
|
||||
return this.client.api.webhooks.opts(this.id, this.token).patch({
|
||||
data: { name, avatar },
|
||||
reason,
|
||||
}).then(data => {
|
||||
@@ -229,7 +229,7 @@ class Webhook {
|
||||
* @returns {Promise}
|
||||
*/
|
||||
delete(reason) {
|
||||
return this.client.api.webhooks(this.id, this.token).delete({ reason });
|
||||
return this.client.api.webhooks.opts(this.id, this.token).delete({ reason });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user