Revert "rewrite ratelimiting and api route builder (#1667)"

This reverts commit a2eeafc75d.
This commit is contained in:
Crawl
2017-07-26 23:00:46 +02:00
parent 317bf4f7cb
commit 07178a0a2a
20 changed files with 316 additions and 187 deletions

View File

@@ -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));
}
}