From d26680495376f6da2a5f8a8b028a4842afe5c8e4 Mon Sep 17 00:00:00 2001 From: bdistin Date: Sun, 2 Jul 2017 03:43:10 -0500 Subject: [PATCH] rest api route fixes (#1645) * start of the rest api router fixes. * fix more missed code --- src/structures/Emoji.js | 2 +- src/structures/GuildChannel.js | 2 +- src/structures/OAuth2Application.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/structures/Emoji.js b/src/structures/Emoji.js index daa3c4f06..fc3ab07e9 100644 --- a/src/structures/Emoji.js +++ b/src/structures/Emoji.js @@ -121,7 +121,7 @@ class Emoji { * .catch(console.error); */ 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: { name: data.name, roles: data.roles ? data.roles.map(r => r.id ? r.id : r) : [], diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index d7466fdb8..ab3e6a10c 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -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 }) .then(() => this); } diff --git a/src/structures/OAuth2Application.js b/src/structures/OAuth2Application.js index c35dcc78c..e9d7a8d79 100644 --- a/src/structures/OAuth2Application.js +++ b/src/structures/OAuth2Application.js @@ -138,7 +138,7 @@ class OAuth2Application { * @returns {OAuth2Application} */ 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)); } @@ -148,7 +148,7 @@ class OAuth2Application { * @returns {OAuth2Application} */ 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 }))); }