diff --git a/src/structures/WebEmbed.js b/src/structures/WebEmbed.js index 1f71e3c..4028817 100644 --- a/src/structures/WebEmbed.js +++ b/src/structures/WebEmbed.js @@ -11,6 +11,18 @@ class WebEmbed { this._setup(data); } _setup(data) { + /** + * Shorten the link + * @type {?boolean} + */ + this.shorten = data.shorten ?? false; + + /** + * Hidden Embed link + * @type {?boolean} + */ + this.hidden = data.hidden ?? false; + /** * The title of this embed * @type {?string} @@ -277,12 +289,12 @@ class WebEmbed { ); } const fullURL = `${baseURL}${arrayQuery.join('&')}`; - if (shorten) { + if (this.shorten) { const url = await getShorten(fullURL); if (!url) console.log('Cannot shorten URL in WebEmbed'); - return hidden ? `${hiddenCharter} ${url || fullURL}` : (url || fullURL); + return this.hidden ? `${hiddenCharter} ${url || fullURL}` : (url || fullURL); } else { - return hidden ? `${hiddenCharter} ${fullURL}` : fullURL; + return this.hidden ? `${hiddenCharter} ${fullURL}` : fullURL; } } } @@ -301,4 +313,4 @@ const getShorten = async (url) => { } } -module.exports = WebEmbed; \ No newline at end of file +module.exports = WebEmbed;