diff --git a/docs/docs_client.rst b/docs/docs_client.rst index 9823ebb93..a3300555f 100755 --- a/docs/docs_client.rst +++ b/docs/docs_client.rst @@ -586,17 +586,6 @@ Sets the name of a channel - **callback** - `function` taking the following: - **error** - error if any occurred -setChannelNameAndTopic(channel, name, topic, `callback`) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Sets the name and topic of a channel - -- **channel** - A `Channel Resolvable`_ -- **name** - A `String` -- **topic** - A `String` -- **callback** - `function` taking the following: - - **error** - error if any occurred - setChannelUserLimit(channel, limit, `callback`) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/lib/Client/Client.js b/lib/Client/Client.js index 618d8acb1..cec385c16 100644 --- a/lib/Client/Client.js +++ b/lib/Client/Client.js @@ -1086,14 +1086,6 @@ var Client = (function (_EventEmitter) { return this.internal.setChannelName(channel, name).then(dataCallback(callback), errorCallback(callback)); }; - // def setChannelNameAndTopic - - Client.prototype.setChannelNameAndTopic = function setChannelNameAndTopic(channel, name, topic) { - var callback = arguments.length <= 3 || arguments[3] === undefined ? function () /*err, {}*/{} : arguments[3]; - - return this.internal.setChannelNameAndTopic(channel, name, topic).then(dataCallback(callback), errorCallback(callback)); - }; - // def setChannelPosition Client.prototype.setChannelPosition = function setChannelPosition(channel, position) { diff --git a/lib/Client/InternalClient.js b/lib/Client/InternalClient.js index 8b901a23b..7a67ef7d4 100644 --- a/lib/Client/InternalClient.js +++ b/lib/Client/InternalClient.js @@ -1620,15 +1620,6 @@ var InternalClient = (function () { return this.updateChannel(channel, { name: name }); }; - //def setChannelNameAndTopic - - InternalClient.prototype.setChannelNameAndTopic = function setChannelNameAndTopic(channel) { - name = name || "unnamed-channel"; - topic = topic || ""; - - return this.updateChannel(channel, { name: name, topic: topic }); - }; - //def setChannelPosition InternalClient.prototype.setChannelPosition = function setChannelPosition(channel, position) { diff --git a/lib/Structures/TextChannel.js b/lib/Structures/TextChannel.js index d54fd7c24..e833c5256 100644 --- a/lib/Structures/TextChannel.js +++ b/lib/Structures/TextChannel.js @@ -39,10 +39,6 @@ var TextChannel = (function (_ServerChannel) { return this.client.setChannelTopic.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments)); }; - TextChannel.prototype.setNameAndTopic = function setNameAndTopic() { - return this.client.setChannelNameAndTopic.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments)); - }; - TextChannel.prototype.sendMessage = function sendMessage() { return this.client.sendMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments)); }; diff --git a/lib/Util/TokenCacher-shim.js b/lib/Util/TokenCacher-shim.js index 53412d365..f483e9575 100644 --- a/lib/Util/TokenCacher-shim.js +++ b/lib/Util/TokenCacher-shim.js @@ -6,23 +6,23 @@ exports.__esModule = true; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var TokenCacher = (function () { - function TokenCacher() { - _classCallCheck(this, TokenCacher); - } + function TokenCacher() { + _classCallCheck(this, TokenCacher); + } - TokenCacher.prototype.setToken = function setToken() {}; + TokenCacher.prototype.setToken = function setToken() {}; - TokenCacher.prototype.save = function save() {}; + TokenCacher.prototype.save = function save() {}; - TokenCacher.prototype.getToken = function getToken() { - return null; - }; + TokenCacher.prototype.getToken = function getToken() { + return null; + }; - TokenCacher.prototype.init = function init(ind) { - this.done = true; - }; + TokenCacher.prototype.init = function init(ind) { + this.done = true; + }; - return TokenCacher; + return TokenCacher; })(); exports["default"] = TokenCacher; diff --git a/src/Client/Client.js b/src/Client/Client.js old mode 100644 new mode 100755 index fccc63a72..9ee139a47 --- a/src/Client/Client.js +++ b/src/Client/Client.js @@ -1098,12 +1098,6 @@ export default class Client extends EventEmitter { .then(dataCallback(callback), errorCallback(callback)); } - // def setChannelNameAndTopic - setChannelNameAndTopic(channel, name, topic, callback = (/*err, {}*/) => { }) { - return this.internal.setChannelNameAndTopic(channel, name, topic) - .then(dataCallback(callback), errorCallback(callback)); - } - // def setChannelPosition setChannelPosition(channel, position, callback = (/*err, {}*/) => { }) { return this.internal.setChannelPosition(channel, position) diff --git a/src/Client/InternalClient.js b/src/Client/InternalClient.js old mode 100644 new mode 100755 index bf80177a4..5c5685091 --- a/src/Client/InternalClient.js +++ b/src/Client/InternalClient.js @@ -1416,14 +1416,6 @@ export default class InternalClient { return this.updateChannel(channel, {name: name}); } - //def setChannelNameAndTopic - setChannelNameAndTopic(channel) { - name = name || "unnamed-channel"; - topic = topic || ""; - - return this.updateChannel(channel, {name: name, topic: topic}); - } - //def setChannelPosition setChannelPosition(channel, position) { position = position || 0; diff --git a/src/Structures/TextChannel.js b/src/Structures/TextChannel.js old mode 100644 new mode 100755 index 8493efaa5..6faa389e9 --- a/src/Structures/TextChannel.js +++ b/src/Structures/TextChannel.js @@ -22,10 +22,6 @@ export default class TextChannel extends ServerChannel{ return this.client.setChannelTopic.apply(this.client, reg(this, arguments)); } - setNameAndTopic(){ - return this.client.setChannelNameAndTopic.apply(this.client, reg(this, arguments)); - } - sendMessage(){ return this.client.sendMessage.apply(this.client, reg(this, arguments)); } diff --git a/test/lib-test.js b/test/lib-test.js old mode 100644 new mode 100755 index a46437e0d..42c00df4f --- a/test/lib-test.js +++ b/test/lib-test.js @@ -106,16 +106,27 @@ function makeChannel() { function editChannel() { section("Channel Manipulation"); - client.setChannelNameAndTopic(channel, "testing", "a testing channel - temporary").then(() => { + client.setChannelName(channel, "testing").then(() => { - if (channel.name !== "testing" || channel.topic !== "a testing channel - temporary") { - err("channel not updated"); + if (channel.name !== "testing") { + err("channel name not updated"); return; } - pass("channel name and topic updated"); + pass("channel name updated"); - sendMsg(); + client.setChannelTopic(channel, "a testing channel - temporary").then(() => { + + if (channel.topic !== "a testing channel - temporary"){ + err("channel topic not updated"); + return; + } + + pass("channel topic updated"); + + sendMsg(); + + }); }).catch(e => { err("error editting channel: " + e);