mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
important build stuff (#1663)
This commit is contained in:
@@ -18,7 +18,7 @@ module.exports = {
|
|||||||
SnowflakeUtil: require('./util/Snowflake'),
|
SnowflakeUtil: require('./util/Snowflake'),
|
||||||
Util: Util,
|
Util: Util,
|
||||||
util: Util,
|
util: Util,
|
||||||
version: require('../package').version,
|
version: require('../package.json').version,
|
||||||
|
|
||||||
// Shortcuts to Util methods
|
// Shortcuts to Util methods
|
||||||
escapeMarkdown: Util.escapeMarkdown,
|
escapeMarkdown: Util.escapeMarkdown,
|
||||||
|
|||||||
@@ -383,29 +383,32 @@ class TextBasedChannel {
|
|||||||
this.messages.set(message.id, message);
|
this.messages.set(message.id, message);
|
||||||
return 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 = []) => {
|
module.exports = TextBasedChannel;
|
||||||
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));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|||||||
Reference in New Issue
Block a user