Organise structure methods

This commit is contained in:
Schuyler Cebulskie
2016-09-07 02:07:39 -04:00
parent 73cb34ed37
commit 818649b94f
13 changed files with 493 additions and 577 deletions

View File

@@ -77,77 +77,58 @@ class GroupDMChannel extends Channel {
this._typing = new Map();
}
equals(other) {
const equal = other &&
this.id === other.id &&
this.name === other.name &&
this.icon === other.icon &&
this.owner.id === other.owner_id;
/**
* Whether this channel equals another channel. It compares all properties, so for most operations
* it is advisable to just compare `channel.id === channel2.id` as it is much faster and is often
* what most users need.
* @param {GroupDMChannel} channel The channel to compare to
* @returns {boolean}
*/
equals(channel) {
const equal = channel &&
this.id === channel.id &&
this.name === channel.name &&
this.icon === channel.icon &&
this.owner.id === channel.owner_id;
if (equal) {
const thisIDs = this.recipients.array().map(r => r.id);
const otherIDs = other.recipients.map(r => r.id);
const otherIDs = channel.recipients.map(r => r.id);
return arraysEqual(thisIDs, otherIDs);
}
return equal;
}
sendMessage() {
return;
/**
* When concatenated with a string, this automatically concatenates the Channel's name instead of the Channel object.
* @returns {string}
* @example
* // logs: Hello from My Group DM!
* console.log(`Hello from ${channel}!`);
* @example
* // logs: Hello from My Group DM!
* console.log(`Hello from ' + channel + '!');
*/
toString() {
return this.name;
}
sendTTSMessage() {
return;
}
sendFile() {
return;
}
_cacheMessage() {
return;
}
fetchMessages() {
return;
}
fetchMessage() {
return;
}
bulkDelete() {
return;
}
startTyping() {
return;
}
stopTyping() {
return;
}
get typing() {
return;
}
get typingCount() {
return;
}
fetchPinnedMessages() {
return;
}
createCollector() {
return;
}
awaitMessages() {
return;
}
// These are here only for documentation purposes - they are implemented by TextBasedChannel
sendMessage() { return; }
sendTTSMessage() { return; }
sendFile() { return; }
fetchMessage() { return; }
fetchMessages() { return; }
fetchPinnedMessages() { return; }
startTyping() { return; }
stopTyping() { return; }
get typing() { return; }
get typingCount() { return; }
createCollector() { return; }
awaitMessages() { return; }
bulkDelete() { return; }
_cacheMessage() { return; }
}
TextBasedChannel.applyToClass(GroupDMChannel, true);