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:
@@ -91,7 +91,7 @@ class ClientUser extends User {
|
||||
if (data.new_password) _data.new_password = data.newPassword;
|
||||
}
|
||||
|
||||
return this.client.api.users['@me'].patch({ data })
|
||||
return this.client.api.users('@me').patch({ data })
|
||||
.then(newData => this.client.actions.UserUpdate.handle(newData).updated);
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ class ClientUser extends User {
|
||||
if (options.guild instanceof Guild) options.guild = options.guild.id;
|
||||
Util.mergeDefault({ limit: 25, roles: true, everyone: true, guild: null }, options);
|
||||
|
||||
return this.client.api.users['@me'].mentions.get({ query: options })
|
||||
return this.client.api.users('@me').mentions.get({ query: options })
|
||||
.then(data => data.map(m => new Message(this.client.channels.get(m.channel_id), m, this.client)));
|
||||
}
|
||||
|
||||
@@ -351,7 +351,7 @@ class ClientUser extends User {
|
||||
return o;
|
||||
}, {}),
|
||||
} : { recipients: recipients.map(u => this.client.resolver.resolveUserID(u)) };
|
||||
return this.client.api.users['@me'].channels.post({ data })
|
||||
return this.client.api.users('@me').channels.post({ data })
|
||||
.then(res => new GroupDMChannel(this.client, res));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user