mirror of
https://github.com/danbulant/discord.js
synced 2026-06-24 17:21:59 +00:00
Remove DMChannel.bulkDelete and GroupDMChannel.bulkDelete
This commit is contained in:
parent
391b618b3f
commit
b5026909a1
3 changed files with 6 additions and 5 deletions
|
|
@ -52,10 +52,10 @@ class DMChannel extends Channel {
|
||||||
get typingCount() { return; }
|
get typingCount() { return; }
|
||||||
createCollector() { return; }
|
createCollector() { return; }
|
||||||
awaitMessages() { return; }
|
awaitMessages() { return; }
|
||||||
bulkDelete() { return; }
|
// doesn't work on DM channels; bulkDelete() { return; }
|
||||||
_cacheMessage() { return; }
|
_cacheMessage() { return; }
|
||||||
}
|
}
|
||||||
|
|
||||||
TextBasedChannel.applyToClass(DMChannel, true);
|
TextBasedChannel.applyToClass(DMChannel, true, ['bulkDelete']);
|
||||||
|
|
||||||
module.exports = DMChannel;
|
module.exports = DMChannel;
|
||||||
|
|
|
||||||
|
|
@ -136,10 +136,10 @@ class GroupDMChannel extends Channel {
|
||||||
get typingCount() { return; }
|
get typingCount() { return; }
|
||||||
createCollector() { return; }
|
createCollector() { return; }
|
||||||
awaitMessages() { return; }
|
awaitMessages() { return; }
|
||||||
bulkDelete() { return; }
|
// doesn't work on group DMs; bulkDelete() { return; }
|
||||||
_cacheMessage() { return; }
|
_cacheMessage() { return; }
|
||||||
}
|
}
|
||||||
|
|
||||||
TextBasedChannel.applyToClass(GroupDMChannel, true);
|
TextBasedChannel.applyToClass(GroupDMChannel, true, ['bulkDelete']);
|
||||||
|
|
||||||
module.exports = GroupDMChannel;
|
module.exports = GroupDMChannel;
|
||||||
|
|
|
||||||
|
|
@ -372,7 +372,7 @@ class TextBasedChannel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.applyToClass = (structure, full = false) => {
|
exports.applyToClass = (structure, full = false, ignore = []) => {
|
||||||
const props = ['send', 'sendMessage', 'sendEmbed', 'sendFile', 'sendCode'];
|
const props = ['send', 'sendMessage', 'sendEmbed', 'sendFile', 'sendCode'];
|
||||||
if (full) {
|
if (full) {
|
||||||
props.push(
|
props.push(
|
||||||
|
|
@ -391,6 +391,7 @@ exports.applyToClass = (structure, full = false) => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
for (const prop of props) {
|
for (const prop of props) {
|
||||||
|
if (ignore.includes(prop)) continue;
|
||||||
Object.defineProperty(structure.prototype, prop, Object.getOwnPropertyDescriptor(TextBasedChannel.prototype, prop));
|
Object.defineProperty(structure.prototype, prop, Object.getOwnPropertyDescriptor(TextBasedChannel.prototype, prop));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue