From 5f7164a540962634a5ac61b158d9df1030bbb549 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Mon, 20 Nov 2017 06:18:28 +0000 Subject: [PATCH] Webpack build for branch custom-structures: cf07b7e3425d78a1abf971f6f8ddd026cfa449c1 --- discord.custom-structures.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/discord.custom-structures.js b/discord.custom-structures.js index 9e3040a9..ee105d7d 100644 --- a/discord.custom-structures.js +++ b/discord.custom-structures.js @@ -9603,6 +9603,8 @@ module.exports = DMChannel; /** * Allows for the extension of built-in Discord.js structures that are instantiated by {@link DataStore DataStores}. + * When extending a built-in structure, it is important to both get the class you're extending from here, + * and to set it here afterwards. */ class Structures { constructor() { @@ -9623,6 +9625,17 @@ class Structures { * Replaces a structure class with an extended one. * @param {string} structure Name of the structure to replace * @param {Function} extended Extended structure class/prototype function to replace with + * @example + * const { Structures } = require('discord.js'); + * + * class CoolGuild extends Structures.get('Guild') { + * constructor(client, data) { + * super(client, data); + * this.cool = true; + * } + * } + * + * Structures.set('Guild', CoolGuild); */ static set(structure, extended) { if (!structures[structure]) throw new RangeError(`"${structure}" is not a valid extensible structure.`);