mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +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:
@@ -189,7 +189,7 @@ class GuildChannel extends Channel {
|
||||
}
|
||||
}
|
||||
|
||||
return this.client.api.channels[this.id].permissions[payload.id]
|
||||
return this.client.api.channels(this.id).permissions[payload.id]
|
||||
.put({ data: payload, reason })
|
||||
.then(() => this);
|
||||
}
|
||||
@@ -216,7 +216,7 @@ class GuildChannel extends Channel {
|
||||
* .catch(console.error);
|
||||
*/
|
||||
edit(data, reason) {
|
||||
return this.client.api.channels[this.id].patch({
|
||||
return this.client.api.channels(this.id).patch({
|
||||
data: {
|
||||
name: (data.name || this.name).trim(),
|
||||
topic: data.topic || this.topic,
|
||||
@@ -289,7 +289,7 @@ class GuildChannel extends Channel {
|
||||
* @returns {Promise<Invite>}
|
||||
*/
|
||||
createInvite({ temporary = false, maxAge = 86400, maxUses = 0, unique, reason } = {}) {
|
||||
return this.client.api.channels[this.id].invites.post({ data: {
|
||||
return this.client.api.channels(this.id).invites.post({ data: {
|
||||
temporary, max_age: maxAge, max_uses: maxUses, unique,
|
||||
}, reason })
|
||||
.then(invite => new Invite(this.client, invite));
|
||||
@@ -353,7 +353,7 @@ class GuildChannel extends Channel {
|
||||
* .catch(console.error); // Log error
|
||||
*/
|
||||
delete(reason) {
|
||||
return this.client.api.channels[this.id].delete({ reason }).then(() => this);
|
||||
return this.client.api.channels(this.id).delete({ reason }).then(() => this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user