mirror of
https://github.com/danbulant/discord.js
synced 2026-05-24 12:35:53 +00:00
important build stuff (#1663)
This commit is contained in:
parent
116fcbd54e
commit
4e5556ba09
2 changed files with 28 additions and 25 deletions
|
|
@ -18,7 +18,7 @@ module.exports = {
|
|||
SnowflakeUtil: require('./util/Snowflake'),
|
||||
Util: Util,
|
||||
util: Util,
|
||||
version: require('../package').version,
|
||||
version: require('../package.json').version,
|
||||
|
||||
// Shortcuts to Util methods
|
||||
escapeMarkdown: Util.escapeMarkdown,
|
||||
|
|
|
|||
|
|
@ -383,29 +383,32 @@ class TextBasedChannel {
|
|||
this.messages.set(message.id, message);
|
||||
return message;
|
||||
}
|
||||
|
||||
static applyToClass(structure, full = false, ignore = []) {
|
||||
const props = ['send'];
|
||||
if (full) {
|
||||
props.push(
|
||||
'_cacheMessage',
|
||||
'acknowledge',
|
||||
'fetchMessages',
|
||||
'fetchMessage',
|
||||
'search',
|
||||
'bulkDelete',
|
||||
'startTyping',
|
||||
'stopTyping',
|
||||
'typing',
|
||||
'typingCount',
|
||||
'fetchPinnedMessages',
|
||||
'createMessageCollector',
|
||||
'awaitMessages'
|
||||
);
|
||||
}
|
||||
for (const prop of props) {
|
||||
if (ignore.includes(prop)) continue;
|
||||
Object.defineProperty(structure.prototype, prop,
|
||||
Object.getOwnPropertyDescriptor(TextBasedChannel.prototype, prop));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.applyToClass = (structure, full = false, ignore = []) => {
|
||||
const props = ['send'];
|
||||
if (full) {
|
||||
props.push(
|
||||
'_cacheMessage',
|
||||
'acknowledge',
|
||||
'fetchMessages',
|
||||
'fetchMessage',
|
||||
'search',
|
||||
'bulkDelete',
|
||||
'startTyping',
|
||||
'stopTyping',
|
||||
'typing',
|
||||
'typingCount',
|
||||
'fetchPinnedMessages',
|
||||
'createMessageCollector',
|
||||
'awaitMessages'
|
||||
);
|
||||
}
|
||||
for (const prop of props) {
|
||||
if (ignore.includes(prop)) continue;
|
||||
Object.defineProperty(structure.prototype, prop, Object.getOwnPropertyDescriptor(TextBasedChannel.prototype, prop));
|
||||
}
|
||||
};
|
||||
module.exports = TextBasedChannel;
|
||||
|
|
|
|||
Loading…
Reference in a new issue