Merge branch 'indev-prism'

This commit is contained in:
Amish Shah
2017-02-23 20:19:26 +00:00
31 changed files with 1397 additions and 766 deletions

View File

@@ -52,10 +52,10 @@ class DMChannel extends Channel {
get typingCount() { return; }
createCollector() { return; }
awaitMessages() { return; }
bulkDelete() { return; }
// doesn't work on DM channels; bulkDelete() { return; }
_cacheMessage() { return; }
}
TextBasedChannel.applyToClass(DMChannel, true);
TextBasedChannel.applyToClass(DMChannel, true, ['bulkDelete']);
module.exports = DMChannel;

View File

@@ -168,10 +168,10 @@ class GroupDMChannel extends Channel {
get typingCount() { return; }
createCollector() { return; }
awaitMessages() { return; }
bulkDelete() { return; }
// doesn't work on group DMs; bulkDelete() { return; }
_cacheMessage() { return; }
}
TextBasedChannel.applyToClass(GroupDMChannel, true);
TextBasedChannel.applyToClass(GroupDMChannel, true, ['bulkDelete']);
module.exports = GroupDMChannel;

View File

@@ -412,7 +412,7 @@ class TextBasedChannel {
}
}
exports.applyToClass = (structure, full = false) => {
exports.applyToClass = (structure, full = false, ignore = []) => {
const props = ['send', 'sendMessage', 'sendEmbed', 'sendFile', 'sendCode'];
if (full) {
props.push(
@@ -431,6 +431,7 @@ exports.applyToClass = (structure, full = false) => {
);
}
for (const prop of props) {
if (ignore.includes(prop)) continue;
Object.defineProperty(structure.prototype, prop, Object.getOwnPropertyDescriptor(TextBasedChannel.prototype, prop));
}
};