mirror of
https://github.com/danbulant/discord.js
synced 2026-06-06 16:22:08 +00:00
rest api route fixes (#1645)
* start of the rest api router fixes. * fix more missed code
This commit is contained in:
parent
8da557faab
commit
d266804953
3 changed files with 4 additions and 4 deletions
|
|
@ -121,7 +121,7 @@ class Emoji {
|
||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
edit(data, reason) {
|
edit(data, reason) {
|
||||||
return this.client.api.guilds[this.guild.id].emojis(this.id)
|
return this.client.api.guilds[this.guild.id].emojis[this.id]
|
||||||
.patch({ data: {
|
.patch({ data: {
|
||||||
name: data.name,
|
name: data.name,
|
||||||
roles: data.roles ? data.roles.map(r => r.id ? r.id : r) : [],
|
roles: data.roles ? data.roles.map(r => r.id ? r.id : r) : [],
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,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 })
|
.put({ data: payload, reason })
|
||||||
.then(() => this);
|
.then(() => this);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ class OAuth2Application {
|
||||||
* @returns {OAuth2Application}
|
* @returns {OAuth2Application}
|
||||||
*/
|
*/
|
||||||
resetSecret() {
|
resetSecret() {
|
||||||
return this.client.api.oauth2.applications(this.id).reset.post()
|
return this.client.api.oauth2.applications[this.id].reset.post()
|
||||||
.then(app => new OAuth2Application(this.client, app));
|
.then(app => new OAuth2Application(this.client, app));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -148,7 +148,7 @@ class OAuth2Application {
|
||||||
* @returns {OAuth2Application}
|
* @returns {OAuth2Application}
|
||||||
*/
|
*/
|
||||||
resetToken() {
|
resetToken() {
|
||||||
return this.client.api.oauth2.applications(this.id).bot().reset.post()
|
return this.client.api.oauth2.applications[this.id].bot.reset.post()
|
||||||
.then(app => new OAuth2Application(this.client, Object.assign({}, this, { bot: app })));
|
.then(app => new OAuth2Application(this.client, Object.assign({}, this, { bot: app })));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue