Remove DMChannel.bulkDelete and GroupDMChannel.bulkDelete

This commit is contained in:
Amish Shah
2017-01-09 18:20:05 +00:00
parent 391b618b3f
commit b5026909a1
3 changed files with 6 additions and 5 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

@@ -136,10 +136,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

@@ -372,7 +372,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(
@@ -391,6 +391,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));
}
};