mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 18:13:29 +01:00
REST API speed improvement (#1577)
This commit is contained in:
@@ -202,7 +202,7 @@ class Role {
|
||||
edit(data, reason) {
|
||||
if (data.permissions) data.permissions = Permissions.resolve(data.permissions);
|
||||
else data.permissions = this.permissions;
|
||||
return this.client.api.guilds(this.guild.id).roles(this.id).patch({
|
||||
return this.client.api.guilds[this.guild.id].roles[this.id].patch({
|
||||
data: {
|
||||
name: data.name || this.name,
|
||||
position: typeof data.position !== 'undefined' ? data.position : this.position,
|
||||
@@ -311,7 +311,7 @@ class Role {
|
||||
* .catch(console.error);
|
||||
*/
|
||||
delete(reason) {
|
||||
return this.client.api.guilds(this.guild.id).roles(this.id).delete({ reason })
|
||||
return this.client.api.guilds[this.guild.id].roles[this.id].delete({ reason })
|
||||
.then(() =>
|
||||
this.client.actions.GuildRoleDelete.handle({ guild_id: this.guild.id, role_id: this.id }).role
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user