mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Removed Client#setChannelNameAndTopic and any relevant references (fixed). (#464)
* Removed undeed functions relating to channelName and channelTopic. * Compiled the last commit.
This commit is contained in:
@@ -586,17 +586,6 @@ Sets the name of a channel
|
|||||||
- **callback** - `function` taking the following:
|
- **callback** - `function` taking the following:
|
||||||
- **error** - error if any occurred
|
- **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`)
|
setChannelUserLimit(channel, limit, `callback`)
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|||||||
@@ -1086,14 +1086,6 @@ var Client = (function (_EventEmitter) {
|
|||||||
return this.internal.setChannelName(channel, name).then(dataCallback(callback), errorCallback(callback));
|
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
|
// def setChannelPosition
|
||||||
|
|
||||||
Client.prototype.setChannelPosition = function setChannelPosition(channel, position) {
|
Client.prototype.setChannelPosition = function setChannelPosition(channel, position) {
|
||||||
|
|||||||
@@ -1620,15 +1620,6 @@ var InternalClient = (function () {
|
|||||||
return this.updateChannel(channel, { name: name });
|
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
|
//def setChannelPosition
|
||||||
|
|
||||||
InternalClient.prototype.setChannelPosition = function setChannelPosition(channel, position) {
|
InternalClient.prototype.setChannelPosition = function setChannelPosition(channel, position) {
|
||||||
|
|||||||
@@ -39,10 +39,6 @@ var TextChannel = (function (_ServerChannel) {
|
|||||||
return this.client.setChannelTopic.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
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() {
|
TextChannel.prototype.sendMessage = function sendMessage() {
|
||||||
return this.client.sendMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
return this.client.sendMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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"); } }
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
var TokenCacher = (function () {
|
var TokenCacher = (function () {
|
||||||
function TokenCacher() {
|
function TokenCacher() {
|
||||||
_classCallCheck(this, 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() {
|
TokenCacher.prototype.getToken = function getToken() {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
TokenCacher.prototype.init = function init(ind) {
|
TokenCacher.prototype.init = function init(ind) {
|
||||||
this.done = true;
|
this.done = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
return TokenCacher;
|
return TokenCacher;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
exports["default"] = TokenCacher;
|
exports["default"] = TokenCacher;
|
||||||
|
|||||||
6
src/Client/Client.js
Normal file → Executable file
6
src/Client/Client.js
Normal file → Executable file
@@ -1098,12 +1098,6 @@ export default class Client extends EventEmitter {
|
|||||||
.then(dataCallback(callback), errorCallback(callback));
|
.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
|
// def setChannelPosition
|
||||||
setChannelPosition(channel, position, callback = (/*err, {}*/) => { }) {
|
setChannelPosition(channel, position, callback = (/*err, {}*/) => { }) {
|
||||||
return this.internal.setChannelPosition(channel, position)
|
return this.internal.setChannelPosition(channel, position)
|
||||||
|
|||||||
8
src/Client/InternalClient.js
Normal file → Executable file
8
src/Client/InternalClient.js
Normal file → Executable file
@@ -1416,14 +1416,6 @@ export default class InternalClient {
|
|||||||
return this.updateChannel(channel, {name: name});
|
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
|
//def setChannelPosition
|
||||||
setChannelPosition(channel, position) {
|
setChannelPosition(channel, position) {
|
||||||
position = position || 0;
|
position = position || 0;
|
||||||
|
|||||||
4
src/Structures/TextChannel.js
Normal file → Executable file
4
src/Structures/TextChannel.js
Normal file → Executable file
@@ -22,10 +22,6 @@ export default class TextChannel extends ServerChannel{
|
|||||||
return this.client.setChannelTopic.apply(this.client, reg(this, arguments));
|
return this.client.setChannelTopic.apply(this.client, reg(this, arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
setNameAndTopic(){
|
|
||||||
return this.client.setChannelNameAndTopic.apply(this.client, reg(this, arguments));
|
|
||||||
}
|
|
||||||
|
|
||||||
sendMessage(){
|
sendMessage(){
|
||||||
return this.client.sendMessage.apply(this.client, reg(this, arguments));
|
return this.client.sendMessage.apply(this.client, reg(this, arguments));
|
||||||
}
|
}
|
||||||
|
|||||||
21
test/lib-test.js
Normal file → Executable file
21
test/lib-test.js
Normal file → Executable file
@@ -106,16 +106,27 @@ function makeChannel() {
|
|||||||
function editChannel() {
|
function editChannel() {
|
||||||
section("Channel Manipulation");
|
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") {
|
if (channel.name !== "testing") {
|
||||||
err("channel not updated");
|
err("channel name not updated");
|
||||||
return;
|
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 => {
|
}).catch(e => {
|
||||||
err("error editting channel: " + e);
|
err("error editting channel: " + e);
|
||||||
|
|||||||
Reference in New Issue
Block a user