diff --git a/Library/_res/0BDFDB.data.json b/Library/_res/0BDFDB.data.json index 77b04dab8f..6e1ff81b43 100644 --- a/Library/_res/0BDFDB.data.json +++ b/Library/_res/0BDFDB.data.json @@ -2,6 +2,8 @@ "PluginNameMap": {}, "PluginUrlMap": { "BDFDB": "https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js", + "CreationDate": "https://mwittrien.github.io/BetterDiscordAddons/_DEAD/CreationDate.plugin.js", + "JoinedAtDate": "https://mwittrien.github.io/BetterDiscordAddons/_DEAD/JoinedAtDate.plugin.js", "ShowHiddenChannels": "https://mwittrien.github.io/BetterDiscordAddons/_DEAD/ShowHiddenChannels.plugin.js" }, "LibraryRequires": ["electron", "fs", "path", "process", "request"], @@ -885,9 +887,6 @@ "threadCreation": "threadCreation-p0fWA_", "uploadCounter": "uploadCounter-iEGQQk" }, - "CreationDate": { - "date": "creationDate-CJwdKT" - }, "CustomStatusPresets": { "customStatusItem": "customStatusItem-f5Trsa", "deleteButton": "deleteButton-k8a4Sa", @@ -936,9 +935,6 @@ "sibling": "sibling-6vI7Pu", "switchIcon": "switchIcon-QY6cR4" }, - "JoinedAtDate": { - "date": "joinedAtDate-IawR02" - }, "LastMessageDate": { "date": "lastMessageDate-ocEw13" }, @@ -1430,7 +1426,6 @@ "_charcounterprofilenotecounter": ["CharCounter", "profileNoteCounter"], "_charcounterthreadcreationcounter": ["CharCounter", "threadCreation"], "_charcounteruploadcounter": ["CharCounter", "uploadCounter"], - "_creationdatedate": ["CreationDate", "date"], "_customstatuspresetscustomstatusitem": ["CustomStatusPresets", "customStatusItem"], "_customstatuspresetsdeletebutton": ["CustomStatusPresets", "deleteButton"], "_customstatuspresetsdeleteicon": ["CustomStatusPresets", "deleteIcon"], @@ -1467,7 +1462,6 @@ "_imageutilitiesprevious": ["ImageUtilities", "previous"], "_imageutilitiessibling": ["ImageUtilities", "sibling"], "_imageutilitiesswitchicon": ["ImageUtilities", "switchIcon"], - "_joinedatdatedate": ["JoinedAtDate", "date"], "_lastmessagedatedate": ["LastMessageDate", "date"], "_oldtitlebarenabled": ["OldTitleBar", "oldTitleBarEnabled"], "_oldtitlebarsettingstoolbar": ["OldTitleBar", "settingsToolbar"], diff --git a/Plugins/CreationDate/CreationDate.plugin.js b/Plugins/CreationDate/CreationDate.plugin.js deleted file mode 100644 index d377e88317..0000000000 --- a/Plugins/CreationDate/CreationDate.plugin.js +++ /dev/null @@ -1,300 +0,0 @@ -/** - * @name CreationDate - * @author DevilBro - * @authorId 278543574059057154 - * @version 1.4.7 - * @description Displays the Creation Date of an Account in the UserPopout and UserModal - * @invite Jx3TjNS - * @donate https://www.paypal.me/MircoWittrien - * @patreon https://www.patreon.com/MircoWittrien - * @website https://mwittrien.github.io/ - * @source https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/CreationDate/ - * @updateUrl https://mwittrien.github.io/BetterDiscordAddons/Plugins/CreationDate/CreationDate.plugin.js - */ - -module.exports = (_ => { - const changeLog = { - - }; - - return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class { - constructor (meta) {for (let key in meta) this[key] = meta[key];} - getName () {return this.name;} - getAuthor () {return this.author;} - getVersion () {return this.version;} - getDescription () {return `The Library Plugin needed for ${this.name} is missing. Open the Plugin Settings to download it. \n\n${this.description}`;} - - downloadLibrary () { - require("request").get("https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js", (e, r, b) => { - if (!e && b && r.statusCode == 200) require("fs").writeFile(require("path").join(BdApi.Plugins.folder, "0BDFDB.plugin.js"), b, _ => BdApi.showToast("Finished downloading BDFDB Library", {type: "success"})); - else BdApi.alert("Error", "Could not download BDFDB Library Plugin. Try again later or download it manually from GitHub: https://mwittrien.github.io/downloader/?library"); - }); - } - - load () { - if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []}); - if (!window.BDFDB_Global.downloadModal) { - window.BDFDB_Global.downloadModal = true; - BdApi.showConfirmationModal("Library Missing", `The Library Plugin needed for ${this.name} is missing. Please click "Download Now" to install it.`, { - confirmText: "Download Now", - cancelText: "Cancel", - onCancel: _ => {delete window.BDFDB_Global.downloadModal;}, - onConfirm: _ => { - delete window.BDFDB_Global.downloadModal; - this.downloadLibrary(); - } - }); - } - if (!window.BDFDB_Global.pluginQueue.includes(this.name)) window.BDFDB_Global.pluginQueue.push(this.name); - } - start () {this.load();} - stop () {} - getSettingsPanel () { - let template = document.createElement("template"); - template.innerHTML = `
The Library Plugin needed for ${this.name} is missing.\nPlease click Download Now to install it.
`; - template.content.firstElementChild.querySelector("a").addEventListener("click", this.downloadLibrary); - return template.content.firstElementChild; - } - } : (([Plugin, BDFDB]) => { - return class CreationDate extends Plugin { - onLoad () { - this.defaults = { - general: { - displayText: {value: true, description: "Display '{{presuffix}}' in the Date"} - }, - places: { - userPopout: {value: true, description: "User Popouts"}, - userProfile: {value: true, description: "User Profile Modal"} - }, - dates: { - creationDate: {value: {}, description: "Creation Date"}, - } - }; - - this.patchedModules = { - after: { - UsernameSection: "default", - UserPopoutInfo: "UserPopoutInfo", - UserProfileModalHeader: "default" - } - }; - - } - - onStart () { - BDFDB.PatchUtils.forceAllUpdates(this); - } - - onStop () { - BDFDB.PatchUtils.forceAllUpdates(this); - } - - getSettingsPanel (collapseStates = {}) { - let settingsPanel; - return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, { - collapseStates: collapseStates, - children: _ => { - let settingsItems = []; - - settingsItems.push(Object.keys(this.defaults.general).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { - type: "Switch", - plugin: this, - keys: ["general", key], - label: key == "displayText" ? this.defaults.general[key].description.replace("{{presuffix}}", this.labels.created_at.replace("{{time}}", "").trim()) : this.defaults.general[key].description, - value: this.settings.general[key] - }))); - - settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormDivider, { - className: BDFDB.disCN.marginbottom8 - })); - - settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsPanelList, { - title: "Add Date in:", - children: Object.keys(this.defaults.places).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { - type: "Switch", - plugin: this, - keys: ["places", key], - label: this.defaults.places[key].description, - value: this.settings.places[key] - })) - })); - - settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormDivider, { - className: BDFDB.disCN.marginbottom8 - })); - - settingsItems.push(Object.keys(this.defaults.dates).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.DateInput, Object.assign({}, this.settings.dates[key], { - label: this.defaults.dates[key].description, - prefix: _ => (this.settings.general.displayText && this.labels.created_at.split("{{time}}")[0] || "").trim(), - suffix: _ => (this.settings.general.displayText && this.labels.created_at.split("{{time}}")[1] || "").trim(), - onChange: valueObj => { - this.SettingsUpdated = true; - this.settings.dates[key] = valueObj; - BDFDB.DataUtils.save(this.settings.dates, this, "dates"); - } - })))); - - return settingsItems.flat(10); - } - }); - } - - onSettingsClosed () { - if (this.SettingsUpdated) { - delete this.SettingsUpdated; - BDFDB.PatchUtils.forceAllUpdates(this); - } - } - - processUsernameSection (e) { - if (e.instance.props.user && this.settings.places.userPopout) { - let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: ["CopiableField", "ColoredFluxTag"]}); - if (index > -1) this.injectDate(children, index + 1, e.instance.props.user); - } - } - - processUserPopoutInfo (e) { - if (e.instance.props.user && this.settings.places.userPopout) { - let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: ["DiscordTag", "ColoredFluxTag"]}); - if (index > -1) this.injectDate(children, index + 1, e.instance.props.user); - } - } - - processUserProfileModalHeader (e) { - if (e.instance.props.user && this.settings.places.userProfile) { - let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: ["DiscordTag", "ColoredFluxTag"]}); - if (index > -1) this.injectDate(children, index + 1, e.instance.props.user); - } - } - - injectDate (children, index, user) { - let timestamp = BDFDB.LibraryComponents.DateInput.format(this.settings.dates.creationDate, user.createdAt); - children.splice(index, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextScroller, { - className: BDFDB.disCNS._creationdatedate + BDFDB.disCNS.userinfodate + BDFDB.disCN.textrow, - children: this.settings.general.displayText ? this.labels.created_at.replace("{{time}}", timestamp) : timestamp - })); - } - - setLabelsByLanguage () { - switch (BDFDB.LanguageUtils.getLanguage().id) { - case "bg": // Bulgarian - return { - created_at: "Създадено на {{time}}" - }; - case "cs": // Czech - return { - created_at: "Vytvořeno {{time}}" - }; - case "da": // Danish - return { - created_at: "Oprettet den {{time}}" - }; - case "de": // German - return { - created_at: "Erstellt am {{time}}" - }; - case "el": // Greek - return { - created_at: "Δημιουργήθηκε στις {{time}}" - }; - case "es": // Spanish - return { - created_at: "Creado el {{time}}" - }; - case "fi": // Finnish - return { - created_at: "Luotu {{time}}" - }; - case "fr": // French - return { - created_at: "Créé le {{time}}" - }; - case "hi": // Hindi - return { - created_at: "{{time}} को बनाया गया" - }; - case "hr": // Croatian - return { - created_at: "Izrađeno {{time}}" - }; - case "hu": // Hungarian - return { - created_at: "Létrehozva: {{time}}" - }; - case "it": // Italian - return { - created_at: "Creato il {{time}}" - }; - case "ja": // Japanese - return { - created_at: "{{time}}に作成" - }; - case "ko": // Korean - return { - created_at: "{{time}}에 생성됨" - }; - case "lt": // Lithuanian - return { - created_at: "Sukurta {{time}}" - }; - case "nl": // Dutch - return { - created_at: "Gemaakt op {{time}}" - }; - case "no": // Norwegian - return { - created_at: "Opprettet {{time}}" - }; - case "pl": // Polish - return { - created_at: "Utworzono {{time}}" - }; - case "pt-BR": // Portuguese (Brazil) - return { - created_at: "Criado em {{time}}" - }; - case "ro": // Romanian - return { - created_at: "Creat la {{time}}" - }; - case "ru": // Russian - return { - created_at: "Создано {{time}}" - }; - case "sv": // Swedish - return { - created_at: "Skapad {{time}}" - }; - case "th": // Thai - return { - created_at: "สร้างเมื่อ {{time}}" - }; - case "tr": // Turkish - return { - created_at: "{{time}} tarihinde oluşturuldu" - }; - case "uk": // Ukrainian - return { - created_at: "Створено {{time}}" - }; - case "vi": // Vietnamese - return { - created_at: "Được tạo vào {{time}}" - }; - case "zh-CN": // Chinese (China) - return { - created_at: "创建于{{time}}" - }; - case "zh-TW": // Chinese (Taiwan) - return { - created_at: "建立於{{time}}" - }; - default: // English - return { - created_at: "Created on {{time}}" - }; - } - } - }; - })(window.BDFDB_Global.PluginUtils.buildPlugin(changeLog)); -})(); \ No newline at end of file diff --git a/Plugins/CreationDate/README.md b/Plugins/CreationDate/README.md deleted file mode 100644 index 4481048893..0000000000 --- a/Plugins/CreationDate/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Creation Date [![Download][download-badge]][download-link] [![Support][support-badge]][support-link] [![PayPal][paypal-badge]][paypal-link] [![Patreon][patreon-badge]][patreon-link] - -[download-badge]: https://img.shields.io/badge/Download-%233a71c1.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAgCAYAAAAIXrg4AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAd5gAAHeYBMKt3fAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAE9SURBVEiJ7ZQ7TsNAFEWv06IAShOkEDD5UNCwB8RCWEYWAqkIYiEgZQERoqLgFz4hUIaC+tCM4cmyk4mxCyRfaSRL8+49781YI3kKOASmwBtw4OvzFnDJry58fZUlGGvme70IQCaVgBLwXwBADegDp0AjaxjQAAbACVCzG+fmGRgDYYJ5ZGpGCfuh80Ya/EwgqWpqQ0lDoLVE5y1JQ+eNVLUFXfdSWr0A7UUTAG1XazUFuvEudoFJrPAd2EsDuMZeY56PyJM0aqohDljU0Lzz7KSMbMMmJB9px/fStoFH/PWMuS9fyBbw4Bnu/cclQe7nhD8BO5nCDaQJ3CWEj/8cbiAbwI0JvwU2cwk3kDpw7FY91/BShSoAmpKOJK3knP0l6SwAriXt5xwe6SoAPiWtFgSYVST1JM2KCJfU+wadgFl0/0HGbQAAAABJRU5ErkJggg== -[download-link]: https://mwittrien.github.io/downloader/?plugin=CreationDate - -[support-badge]: https://img.shields.io/badge/Support-%2343b581.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAC4UlEQVRYR8WXS4jNcRTHP195bEgWkoVsCAspNcVoLGblsaAoFCalBqU8BhuPPDZeQ5LBRmHBYsok7KYor5TyKDI2UiQLZWwojs6d351+85977+93J7q/uqt7Hp/fOed3zvmLzGNm44BWYAUwB5gafm7hc/i9AXqAXkk/c0wrJWRmU4BDwHpgQko+/N8PXAcOS/pSS6cqgJmNBfYBe4HxmY6LYj+AE8BxSb8q2agIEG7dDSwaoeOi2kNgVaVoDAMws7nAHWDaP3JeNvMRWC7pVWx3CEC4+bMM533AE+B5MDYfWADMTEA7RFMciUGAkPPeRNi9svcDnZL+xM7MbBSwCzgG+IupdjwdreWaiAEOAEdqKLrzZknlW1cUNTOPxqMExEFJR91ACSCE/n2i2vdIOpVTF2bWAZysIeuvY4anogxwAdhaQ8FzPjsOu5lNAjYFnSuSvpX1QzreJmqiS9I2hQ73NdFkrknaGDlw5x8iHW880wsQV4ENNS7lOpMdYClwNxHanZLORgBebKcLOrsldUYyO4AzCbvLHOAi0J4QbJd0OTJ+D1iSANgOnEvYveQA94HFCcHvgDv1M7GC80op6AK2JOw+cIB3GQ2kmh1/Oe6oWISjgdfArARAnwM4fb3D5jew0lu2JCs6MbOc8Lvaj5EC9EhygGHHzFqA2yFVqbZRAhhJCtok+TMbPGY2BmgDzie6YKxWSkFOERZvsk7SjehVbA4zwJeXek6pCHOeYdHoWkk3IwCHWVOP5yBbeoY5jahoO6cv5PCUGpGPzlQrLhpL9YUc5wOt2CXNLDWMKhn0ifYSWFieqjleI5mBYRQAvHhS4zi2/wJokdRvZk3A0zohho7jAJFaSGKADkmDw8jMfMtpriMCQxeSAOBreGolK/volrQ66Pm3wqc6umnllSxKRc5S6q34FvA4zPx5mbevvpRGb7pxa3kE4UXZmA+TCKJxn2ZxPhv2cVosqv/1ef4XvUY7+DQzteEAAAAASUVORK5CYII= -[support-link]: https://discord.com/invite/Jx3TjNS - -[paypal-badge]: https://img.shields.io/badge/PayPal-%23003087.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAgCAYAAAABtRhCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAdhwAAHYcBj+XxZQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAIZSURBVEiJvZa7a1RREIe/CRsIqBBQJEEUO5+YRgSx0JTBwkKwsBMU/4HY2dmKFmm1tRBREEGFYGMhvgolPlBsRBuJj5iIiRvzWWxuOF7v3r2Ld/ODhXNmhvnOzHnshZzU82rTamqqn9XX6jV1XB3K52wrtaHOV4S104J6Ue2vAtz2n7BUt9S+PCNv2FG5HZ11GDi1mkCA052AO2sG7s63tdcV9gON1BDZQA1gFlhTI3AmIgZTQ1rhlpphAFN5Qwqse/8A7uYNaX/r3j+Am9lAHQbmegmcjIhnyfwosLFXwEXgbM52BBhemdl6hOvSeEpSR9QldTYzDNUE+q2eyZer3lj2rwBHa4A9UA8UwE4kMS+yPexm/xZpPRDTwBvgCXA9Ip4XwEaBicT0MHNMlKz8ijrQxYKynMfVn7lcxzLnZAnwYJegEfV2QZ6P6kDW0rJX5lUHwAZgD7CP1l3b2yb0XETMow6WVDedS35Bfbf8+2LrqFfRVVt/DqDuLwm8nwM+qghIdcnk+6aP8hO60s7lFW4va2+iReAOcCgiTkZEM3M0OgBfJuNNwLqCmHvAY+AbMAO8BZ5GxNeihA2qH5iiuO/AWET8Ksnxl/o6ANMKizox1Q0sA65t45sDPiTzov0rvTJFagC7gM0FvoWIMJkXVdg1sLLUTwVHfqxXsPVt7tjWbnP98+3fRkXt/AG8Xy3gEnA5Ipa6Bf4BbzmPtw84RMAAAAAASUVORK5CYII= -[paypal-link]: https://paypal.me/MircoWittrien - -[patreon-badge]: https://img.shields.io/badge/Patreon-%23F96854.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAdhwAAHYcBj+XxZQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAGBSURBVFiF7Za9ThtBFEbPBUpERWMwCorfJjY4aVLxBFHCKyCl4hWQUqVMBULmbfiRCNACqSJsDsXakjHGO8Y7ovFXrmbmO3NnZ74bqrzUeUR8HPP9mdQ60AZawCZQBwK4BC6ADnAUEZeTFhmnsxLjdfVAfXhl/rB66h/1QyUAalu9TzAe1Z26NROAutvf0VvVU7+/CUD9PKP5MMT2VADqhvqvAvOB7tQ1gIXXznpEP4HlxLEpWgH2AEInX0OLv/cUWKwQAKALbKZU4EsGc4AloJ0C8CmD+UDNFIBGRoBGCkAtI8B66i3IpccUgJuMANcpAKcZAc5SAE4yAnRSAA6BXgbzLnBUChARF8DvDAC/IuIqNYzqFYfRrVqDxDCKiL/AV6o5ikdgJyJuBrsrrcBQJX44W0/QVb+NLpoM0B/f6pdwWt2qL3NlWoD+nFV1X/2fYPxg0cCOfdJL+4ESkBqwDTQpQmuNoi2/onjAOsBxRFxPWmTqClSp9w6jOcAcYA7AE1OMk5ulhBZCAAAAAElFTkSuQmCC -[patreon-link]: https://patreon.com/MircoWittrien - -Displays the Creation Date of an Account in the UserPopout and UserModal - - -User Popout: - -![screenshot1](https://mwittrien.github.io/BetterDiscordAddons/Plugins/CreationDate/_res/screenshot1.png) - -User Profile: - -![screenshot2](https://mwittrien.github.io/BetterDiscordAddons/Plugins/CreationDate/_res/screenshot2.png) \ No newline at end of file diff --git a/Plugins/CreationDate/_res/cover.png b/Plugins/CreationDate/_res/cover.png deleted file mode 100644 index 93089e16b9..0000000000 Binary files a/Plugins/CreationDate/_res/cover.png and /dev/null differ diff --git a/Plugins/CreationDate/_res/screenshot1.png b/Plugins/CreationDate/_res/screenshot1.png deleted file mode 100644 index 7e95a8e4e3..0000000000 Binary files a/Plugins/CreationDate/_res/screenshot1.png and /dev/null differ diff --git a/Plugins/CreationDate/_res/screenshot2.png b/Plugins/CreationDate/_res/screenshot2.png deleted file mode 100644 index ba46d6ada8..0000000000 Binary files a/Plugins/CreationDate/_res/screenshot2.png and /dev/null differ diff --git a/Plugins/JoinedAtDate/JoinedAtDate.plugin.js b/Plugins/JoinedAtDate/JoinedAtDate.plugin.js deleted file mode 100644 index 1892d41f96..0000000000 --- a/Plugins/JoinedAtDate/JoinedAtDate.plugin.js +++ /dev/null @@ -1,353 +0,0 @@ -/** - * @name JoinedAtDate - * @author DevilBro - * @authorId 278543574059057154 - * @version 1.3.4 - * @description Displays the Joined At Date of a Member in the UserPopout and UserModal - * @invite Jx3TjNS - * @donate https://www.paypal.me/MircoWittrien - * @patreon https://www.patreon.com/MircoWittrien - * @website https://mwittrien.github.io/ - * @source https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/JoinedAtDate/ - * @updateUrl https://mwittrien.github.io/BetterDiscordAddons/Plugins/JoinedAtDate/JoinedAtDate.plugin.js - */ - -module.exports = (_ => { - const changeLog = { - - }; - - return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class { - constructor (meta) {for (let key in meta) this[key] = meta[key];} - getName () {return this.name;} - getAuthor () {return this.author;} - getVersion () {return this.version;} - getDescription () {return `The Library Plugin needed for ${this.name} is missing. Open the Plugin Settings to download it. \n\n${this.description}`;} - - downloadLibrary () { - require("request").get("https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js", (e, r, b) => { - if (!e && b && r.statusCode == 200) require("fs").writeFile(require("path").join(BdApi.Plugins.folder, "0BDFDB.plugin.js"), b, _ => BdApi.showToast("Finished downloading BDFDB Library", {type: "success"})); - else BdApi.alert("Error", "Could not download BDFDB Library Plugin. Try again later or download it manually from GitHub: https://mwittrien.github.io/downloader/?library"); - }); - } - - load () { - if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []}); - if (!window.BDFDB_Global.downloadModal) { - window.BDFDB_Global.downloadModal = true; - BdApi.showConfirmationModal("Library Missing", `The Library Plugin needed for ${this.name} is missing. Please click "Download Now" to install it.`, { - confirmText: "Download Now", - cancelText: "Cancel", - onCancel: _ => {delete window.BDFDB_Global.downloadModal;}, - onConfirm: _ => { - delete window.BDFDB_Global.downloadModal; - this.downloadLibrary(); - } - }); - } - if (!window.BDFDB_Global.pluginQueue.includes(this.name)) window.BDFDB_Global.pluginQueue.push(this.name); - } - start () {this.load();} - stop () {} - getSettingsPanel () { - let template = document.createElement("template"); - template.innerHTML = `
The Library Plugin needed for ${this.name} is missing.\nPlease click Download Now to install it.
`; - template.content.firstElementChild.querySelector("a").addEventListener("click", this.downloadLibrary); - return template.content.firstElementChild; - } - } : (([Plugin, BDFDB]) => { - var _this; - var loadedUsers, requestedUsers, queuedInstances; - var currentPopout, currentProfile; - - return class JoinedAtDate extends Plugin { - onLoad () { - _this = this; - loadedUsers = {}; - requestedUsers = {}; - queuedInstances = {}; - - this.defaults = { - general: { - displayText: {value: true, description: "Display '{{presuffix}}' in the Date"} - }, - places: { - userPopout: {value: true, description: "User Popouts"}, - userProfile: {value: true, description: "User Profile Modal"} - }, - dates: { - joinedAtDate: {value: {}, description: "Joined at Date"}, - } - }; - - this.patchedModules = { - after: { - UserPopoutExperimentWrapper: "default", - UserPopoutContainer: "type", - UsernameSection: "default", - UserPopoutInfo: "UserPopoutInfo", - UserProfileModal: "default", - UserProfileModalHeader: "default" - } - }; - } - - onStart () { - BDFDB.PatchUtils.forceAllUpdates(this); - } - - onStop () { - BDFDB.PatchUtils.forceAllUpdates(this); - } - - getSettingsPanel (collapseStates = {}) { - let settingsPanel; - return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, { - collapseStates: collapseStates, - children: _ => { - let settingsItems = []; - - settingsItems.push(Object.keys(this.defaults.general).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { - type: "Switch", - plugin: this, - keys: ["general", key], - label: key == "displayText" ? this.defaults.general[key].description.replace("{{presuffix}}", this.labels.joined_at.replace("{{time}}", "").trim()) : this.defaults.general[key].description, - value: this.settings.general[key] - }))); - - settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormDivider, { - className: BDFDB.disCN.marginbottom8 - })); - - settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsPanelList, { - title: "Add Date in:", - children: Object.keys(this.defaults.places).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { - type: "Switch", - plugin: this, - keys: ["places", key], - label: this.defaults.places[key].description, - value: this.settings.places[key] - })) - })); - - settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormDivider, { - className: BDFDB.disCN.marginbottom8 - })); - - settingsItems.push(Object.keys(this.defaults.dates).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.DateInput, Object.assign({}, this.settings.dates[key], { - label: this.defaults.dates[key].description, - prefix: _ => (this.settings.general.displayText && this.labels.joined_at.split("{{time}}")[0] || "").trim(), - suffix: _ => (this.settings.general.displayText && this.labels.joined_at.split("{{time}}")[1] || "").trim(), - onChange: valueObj => { - this.SettingsUpdated = true; - this.settings.dates[key] = valueObj; - BDFDB.DataUtils.save(this.settings.dates, this, "dates"); - } - })))); - - return settingsItems.flat(10); - } - }); - } - - onSettingsClosed () { - if (this.SettingsUpdated) { - delete this.SettingsUpdated; - BDFDB.PatchUtils.forceAllUpdates(this); - } - } - - processUserPopoutExperimentWrapper (e) { - currentPopout = e.instance; - } - - processUserPopoutContainer (e) { - currentPopout = e.instance; - } - - processUsernameSection (e) { - if (currentPopout && e.instance.props.user && this.settings.places.userPopout) { - let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: ["CopiableField", "ColoredFluxTag"]}); - if (index > -1) this.injectDate(children, index + 1, e.instance.props.user, currentPopout.props.guildId); - } - } - - processUserPopoutInfo (e) { - if (currentPopout && e.instance.props.user && this.settings.places.userPopout) { - let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: ["DiscordTag", "ColoredFluxTag"]}); - if (index > -1) this.injectDate(children, index + 1, e.instance.props.user, currentPopout.props.guildId); - } - } - - processUserProfileModal (e) { - currentProfile = e.instance; - } - - processUserProfileModalHeader (e) { - if (currentProfile && e.instance.props.user && this.settings.places.userProfile) { - let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: ["DiscordTag", "ColoredFluxTag"]}); - if (index > -1) this.injectDate(children, index + 1, e.instance.props.user, currentProfile.props.guildId); - } - } - - injectDate (children, index, user, guildId) { - if (!guildId) guildId = BDFDB.LibraryStores.SelectedGuildStore.getGuildId(); - if (!BDFDB.ArrayUtils.is(children) || !user || !guildId || user.isNonUserBot() || !BDFDB.LibraryStores.GuildMemberStore.getMember(guildId, user.id)) return; - - if (!loadedUsers[guildId]) loadedUsers[guildId] = {}; - if (!requestedUsers[guildId]) requestedUsers[guildId] = {}; - if (!queuedInstances[guildId]) queuedInstances[guildId] = {}; - - if (!loadedUsers[guildId][user.id] && !requestedUsers[guildId][user.id]) { - requestedUsers[guildId][user.id] = true; - queuedInstances[guildId][user.id] = [].concat(queuedInstances[guildId][user.id]).filter(n => n); - BDFDB.LibraryModules.APIUtils.get(BDFDB.DiscordConstants.Endpoints.GUILD_MEMBER(guildId, user.id)).then(result => { - delete requestedUsers[guildId][user.id]; - if (typeof result.body.retry_after != "number") { - loadedUsers[guildId][user.id] = new Date(result.body.joined_at); - BDFDB.ReactUtils.forceUpdate(queuedInstances[guildId][user.id]); - delete queuedInstances[guildId][user.id]; - } - else BDFDB.TimeUtils.timeout(_ => this.injectDate(children, index, user, guildId), result.body.retry_after + 500); - }); - } - children.splice(index, 0, BDFDB.ReactUtils.createElement(class extends BDFDB.ReactUtils.Component { - render() { - if (!loadedUsers[guildId][user.id]) { - if (queuedInstances[guildId][user.id].indexOf(this) == -1) queuedInstances[guildId][user.id].push(this); - return null; - } - else { - let timestamp = BDFDB.LibraryComponents.DateInput.format(_this.settings.dates.joinedAtDate, loadedUsers[guildId][user.id]); - return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextScroller, { - className: BDFDB.disCNS._joinedatdatedate + BDFDB.disCNS.userinfodate + BDFDB.disCN.textrow, - children: _this.settings.general.displayText ? _this.labels.joined_at.replace("{{time}}", timestamp) : timestamp - }); - } - } - })); - } - - setLabelsByLanguage () { - switch (BDFDB.LanguageUtils.getLanguage().id) { - case "bg": // Bulgarian - return { - joined_at: "Присъединил се на {{time}}" - }; - case "cs": // Czech - return { - joined_at: "Připojeno {{time}}" - }; - case "da": // Danish - return { - joined_at: "Deltog den {{time}}" - }; - case "de": // German - return { - joined_at: "Beitritt am {{time}}" - }; - case "el": // Greek - return { - joined_at: "Έγινε μέλος στις {{time}}" - }; - case "es": // Spanish - return { - joined_at: "Se unió el {{time}}" - }; - case "fi": // Finnish - return { - joined_at: "Liittyi {{time}}" - }; - case "fr": // French - return { - joined_at: "Rejoint le {{time}}" - }; - case "hi": // Hindi - return { - joined_at: "{{time}} को शामिल हुए" - }; - case "hr": // Croatian - return { - joined_at: "Pridružio se {{time}}" - }; - case "hu": // Hungarian - return { - joined_at: "Csatlakozott: {{time}}" - }; - case "it": // Italian - return { - joined_at: "Iscritto il {{time}}" - }; - case "ja": // Japanese - return { - joined_at: "{{time}}に参加しました" - }; - case "ko": // Korean - return { - joined_at: "{{time}}에 가입했습니다." - }; - case "lt": // Lithuanian - return { - joined_at: "Prisijungė {{time}}" - }; - case "nl": // Dutch - return { - joined_at: "Aangesloten op {{time}}" - }; - case "no": // Norwegian - return { - joined_at: "Ble med {{time}}" - }; - case "pl": // Polish - return { - joined_at: "Dołączono {{time}}" - }; - case "pt-BR": // Portuguese (Brazil) - return { - joined_at: "Entrou em {{time}}" - }; - case "ro": // Romanian - return { - joined_at: "S-a înscris pe {{time}}" - }; - case "ru": // Russian - return { - joined_at: "Присоединился {{time}}" - }; - case "sv": // Swedish - return { - joined_at: "Gick med den {{time}}" - }; - case "th": // Thai - return { - joined_at: "เข้าร่วมเมื่อ {{time}}" - }; - case "tr": // Turkish - return { - joined_at: "{{time}} tarihinde katıldı" - }; - case "uk": // Ukrainian - return { - joined_at: "Приєднався {{time}}" - }; - case "vi": // Vietnamese - return { - joined_at: "Đã tham gia vào {{time}}" - }; - case "zh-CN": // Chinese (China) - return { - joined_at: "已于{{time}}加入" - }; - case "zh-TW": // Chinese (Taiwan) - return { - joined_at: "已於{{time}}加入" - }; - default: // English - return { - joined_at: "Joined on {{time}}" - }; - } - } - }; - })(window.BDFDB_Global.PluginUtils.buildPlugin(changeLog)); -})(); \ No newline at end of file diff --git a/Plugins/JoinedAtDate/README.md b/Plugins/JoinedAtDate/README.md deleted file mode 100644 index 2f331e3f45..0000000000 --- a/Plugins/JoinedAtDate/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Joined At Date [![Download][download-badge]][download-link] [![Support][support-badge]][support-link] [![PayPal][paypal-badge]][paypal-link] [![Patreon][patreon-badge]][patreon-link] - -[download-badge]: https://img.shields.io/badge/Download-%233a71c1.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAgCAYAAAAIXrg4AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAd5gAAHeYBMKt3fAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAE9SURBVEiJ7ZQ7TsNAFEWv06IAShOkEDD5UNCwB8RCWEYWAqkIYiEgZQERoqLgFz4hUIaC+tCM4cmyk4mxCyRfaSRL8+49781YI3kKOASmwBtw4OvzFnDJry58fZUlGGvme70IQCaVgBLwXwBADegDp0AjaxjQAAbACVCzG+fmGRgDYYJ5ZGpGCfuh80Ya/EwgqWpqQ0lDoLVE5y1JQ+eNVLUFXfdSWr0A7UUTAG1XazUFuvEudoFJrPAd2EsDuMZeY56PyJM0aqohDljU0Lzz7KSMbMMmJB9px/fStoFH/PWMuS9fyBbw4Bnu/cclQe7nhD8BO5nCDaQJ3CWEj/8cbiAbwI0JvwU2cwk3kDpw7FY91/BShSoAmpKOJK3knP0l6SwAriXt5xwe6SoAPiWtFgSYVST1JM2KCJfU+wadgFl0/0HGbQAAAABJRU5ErkJggg== -[download-link]: https://mwittrien.github.io/downloader/?plugin=JoinedAtDate - -[support-badge]: https://img.shields.io/badge/Support-%2343b581.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAC4UlEQVRYR8WXS4jNcRTHP195bEgWkoVsCAspNcVoLGblsaAoFCalBqU8BhuPPDZeQ5LBRmHBYsok7KYor5TyKDI2UiQLZWwojs6d351+85977+93J7q/uqt7Hp/fOed3zvmLzGNm44BWYAUwB5gafm7hc/i9AXqAXkk/c0wrJWRmU4BDwHpgQko+/N8PXAcOS/pSS6cqgJmNBfYBe4HxmY6LYj+AE8BxSb8q2agIEG7dDSwaoeOi2kNgVaVoDAMws7nAHWDaP3JeNvMRWC7pVWx3CEC4+bMM533AE+B5MDYfWADMTEA7RFMciUGAkPPeRNi9svcDnZL+xM7MbBSwCzgG+IupdjwdreWaiAEOAEdqKLrzZknlW1cUNTOPxqMExEFJR91ACSCE/n2i2vdIOpVTF2bWAZysIeuvY4anogxwAdhaQ8FzPjsOu5lNAjYFnSuSvpX1QzreJmqiS9I2hQ73NdFkrknaGDlw5x8iHW880wsQV4ENNS7lOpMdYClwNxHanZLORgBebKcLOrsldUYyO4AzCbvLHOAi0J4QbJd0OTJ+D1iSANgOnEvYveQA94HFCcHvgDv1M7GC80op6AK2JOw+cIB3GQ2kmh1/Oe6oWISjgdfArARAnwM4fb3D5jew0lu2JCs6MbOc8Lvaj5EC9EhygGHHzFqA2yFVqbZRAhhJCtok+TMbPGY2BmgDzie6YKxWSkFOERZvsk7SjehVbA4zwJeXek6pCHOeYdHoWkk3IwCHWVOP5yBbeoY5jahoO6cv5PCUGpGPzlQrLhpL9YUc5wOt2CXNLDWMKhn0ifYSWFieqjleI5mBYRQAvHhS4zi2/wJokdRvZk3A0zohho7jAJFaSGKADkmDw8jMfMtpriMCQxeSAOBreGolK/volrQ66Pm3wqc6umnllSxKRc5S6q34FvA4zPx5mbevvpRGb7pxa3kE4UXZmA+TCKJxn2ZxPhv2cVosqv/1ef4XvUY7+DQzteEAAAAASUVORK5CYII= -[support-link]: https://discord.com/invite/Jx3TjNS - -[paypal-badge]: https://img.shields.io/badge/PayPal-%23003087.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAgCAYAAAABtRhCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAdhwAAHYcBj+XxZQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAIZSURBVEiJvZa7a1RREIe/CRsIqBBQJEEUO5+YRgSx0JTBwkKwsBMU/4HY2dmKFmm1tRBREEGFYGMhvgolPlBsRBuJj5iIiRvzWWxuOF7v3r2Ld/ODhXNmhvnOzHnshZzU82rTamqqn9XX6jV1XB3K52wrtaHOV4S104J6Ue2vAtz2n7BUt9S+PCNv2FG5HZ11GDi1mkCA052AO2sG7s63tdcV9gON1BDZQA1gFlhTI3AmIgZTQ1rhlpphAFN5Qwqse/8A7uYNaX/r3j+Am9lAHQbmegmcjIhnyfwosLFXwEXgbM52BBhemdl6hOvSeEpSR9QldTYzDNUE+q2eyZer3lj2rwBHa4A9UA8UwE4kMS+yPexm/xZpPRDTwBvgCXA9Ip4XwEaBicT0MHNMlKz8ijrQxYKynMfVn7lcxzLnZAnwYJegEfV2QZ6P6kDW0rJX5lUHwAZgD7CP1l3b2yb0XETMow6WVDedS35Bfbf8+2LrqFfRVVt/DqDuLwm8nwM+qghIdcnk+6aP8hO60s7lFW4va2+iReAOcCgiTkZEM3M0OgBfJuNNwLqCmHvAY+AbMAO8BZ5GxNeihA2qH5iiuO/AWET8Ksnxl/o6ANMKizox1Q0sA65t45sDPiTzov0rvTJFagC7gM0FvoWIMJkXVdg1sLLUTwVHfqxXsPVt7tjWbnP98+3fRkXt/AG8Xy3gEnA5Ipa6Bf4BbzmPtw84RMAAAAAASUVORK5CYII= -[paypal-link]: https://paypal.me/MircoWittrien - -[patreon-badge]: https://img.shields.io/badge/Patreon-%23F96854.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAdhwAAHYcBj+XxZQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAGBSURBVFiF7Za9ThtBFEbPBUpERWMwCorfJjY4aVLxBFHCKyCl4hWQUqVMBULmbfiRCNACqSJsDsXakjHGO8Y7ovFXrmbmO3NnZ74bqrzUeUR8HPP9mdQ60AZawCZQBwK4BC6ADnAUEZeTFhmnsxLjdfVAfXhl/rB66h/1QyUAalu9TzAe1Z26NROAutvf0VvVU7+/CUD9PKP5MMT2VADqhvqvAvOB7tQ1gIXXznpEP4HlxLEpWgH2AEInX0OLv/cUWKwQAKALbKZU4EsGc4AloJ0C8CmD+UDNFIBGRoBGCkAtI8B66i3IpccUgJuMANcpAKcZAc5SAE4yAnRSAA6BXgbzLnBUChARF8DvDAC/IuIqNYzqFYfRrVqDxDCKiL/AV6o5ikdgJyJuBrsrrcBQJX44W0/QVb+NLpoM0B/f6pdwWt2qL3NlWoD+nFV1X/2fYPxg0cCOfdJL+4ESkBqwDTQpQmuNoi2/onjAOsBxRFxPWmTqClSp9w6jOcAcYA7AE1OMk5ulhBZCAAAAAElFTkSuQmCC -[patreon-link]: https://patreon.com/MircoWittrien - -Displays the Joined At Date of a Member in the UserPopout and UserModal - - -User Popout: - -![screenshot1](https://mwittrien.github.io/BetterDiscordAddons/Plugins/JoinedAtDate/_res/screenshot1.png) - -User Profile: - -![screenshot2](https://mwittrien.github.io/BetterDiscordAddons/Plugins/JoinedAtDate/_res/screenshot2.png) \ No newline at end of file diff --git a/Plugins/JoinedAtDate/_res/cover.png b/Plugins/JoinedAtDate/_res/cover.png deleted file mode 100644 index 9f87e80030..0000000000 Binary files a/Plugins/JoinedAtDate/_res/cover.png and /dev/null differ diff --git a/Plugins/JoinedAtDate/_res/screenshot1.png b/Plugins/JoinedAtDate/_res/screenshot1.png deleted file mode 100644 index ba14cabf29..0000000000 Binary files a/Plugins/JoinedAtDate/_res/screenshot1.png and /dev/null differ diff --git a/Plugins/JoinedAtDate/_res/screenshot2.png b/Plugins/JoinedAtDate/_res/screenshot2.png deleted file mode 100644 index 1fc19f07f6..0000000000 Binary files a/Plugins/JoinedAtDate/_res/screenshot2.png and /dev/null differ diff --git a/Plugins/README.md b/Plugins/README.md index fe999baca2..4490aac66e 100644 --- a/Plugins/README.md +++ b/Plugins/README.md @@ -17,7 +17,6 @@ - [Chat Filter](https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/ChatFilter) - Allows you to censor Words or block complete Messages/Statuses - [Complete Timestamps](https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/CompleteTimestamps) - Replaces Timestamps with your own custom Timestamps - [Copy Raw Message](https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/CopyRawMessage) - Allows you to copy the raw Contents of a Message - - [Creation Date](https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/CreationDate) - Displays the Creation Date of an Account in the UserPopout and UserModal - [Custom Quoter](https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/CustomQuoter) - Brings back the Quote Feature and allows you to set your own Quote Formats - [Custom Status Presets](https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/CustomStatusPresets) - Allows you to save Custom Statuses as Quick Select - [Display Servers As Channels](https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/DisplayServersAsChannels) - Displays Servers in a similar way as Channels @@ -32,7 +31,6 @@ - [Google Search Replace](https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/GoogleSearchReplace) - Replaces the default Google Text Search with a custom Search Engine - [Hide Muted Categories](https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/HideMutedCategories) - Hides muted Categories, if muted Channels are hidden - [Image Utilities](https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/ImageUtilities) - Adds several Utilities for Images/Videos (Gallery, Download, Reverse Search, Zoom, Copy, etc.) - - [Joined At Date](https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/JoinedAtDate) - Displays the Joined At Date of a Member in the UserPopout and UserModal - [Last Message Date](https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/LastMessageDate) - Displays the Last Message Date of a Member for the current Server/DM in the UserPopout and UserModal - [Message Utilities](https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/MessageUtilities) - Adds several Quick Actions for Messages (Delete, Edit, Pin, etc.) - [Notification Sounds](https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/NotificationSounds) - Allows you to replace the native Sounds with custom Sounds diff --git a/_DEAD/CreationDate.plugin.js b/_DEAD/CreationDate.plugin.js new file mode 100644 index 0000000000..fa238ae36e --- /dev/null +++ b/_DEAD/CreationDate.plugin.js @@ -0,0 +1,76 @@ +/** + * @name CreationDate + * @author DevilBro + * @authorId 278543574059057154 + * @version 9.9.9 + * @description PLUGIN WAS DISCONTINUED + */ + +module.exports = (_ => { + const changeLog = {}; + + return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class { + constructor (meta) {for (let key in meta) this[key] = meta[key];} + getName () {return this.name;} + getAuthor () {return this.author;} + getVersion () {return this.version;} + getDescription () {return `The Library Plugin needed for ${this.name} is missing. Open the Plugin Settings to download it. \n\n${this.description}`;} + + downloadLibrary () { + require("request").get("https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js", (e, r, b) => { + if (!e && b && r.statusCode == 200) require("fs").writeFile(require("path").join(BdApi.Plugins.folder, "0BDFDB.plugin.js"), b, _ => BdApi.showToast("Finished downloading BDFDB Library", {type: "success"})); + else BdApi.alert("Error", "Could not download BDFDB Library Plugin. Try again later or download it manually from GitHub: https://mwittrien.github.io/downloader/?library"); + }); + } + + load () { + if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []}); + if (!window.BDFDB_Global.downloadModal) { + window.BDFDB_Global.downloadModal = true; + BdApi.showConfirmationModal("Library Missing", `The Library Plugin needed for ${this.name} is missing. Please click "Download Now" to install it.`, { + confirmText: "Download Now", + cancelText: "Cancel", + onCancel: _ => {delete window.BDFDB_Global.downloadModal;}, + onConfirm: _ => { + delete window.BDFDB_Global.downloadModal; + this.downloadLibrary(); + } + }); + } + if (!window.BDFDB_Global.pluginQueue.includes(this.name)) window.BDFDB_Global.pluginQueue.push(this.name); + } + start () {this.load();} + stop () {} + getSettingsPanel () { + let template = document.createElement("template"); + template.innerHTML = `
The Library Plugin needed for ${this.name} is missing.\nPlease click Download Now to install it.
`; + template.content.firstElementChild.querySelector("a").addEventListener("click", this.downloadLibrary); + return template.content.firstElementChild; + } + } : (([Plugin, BDFDB]) => { + return class CreationDate extends Plugin { + onLoad () {} + + onStart () { + BDFDB.ModalUtils.open(this, { + header: "PLUGIN WAS DISCONTINUED", + children: [ + BDFDB.ReactUtils.createElement("span", {children: "DISCORD ADDED THIS FEATURE BY THEMSELVES, MAKING THIS PLUGIN USELESS "}), + BDFDB.ReactUtils.createElement("strong", {children: "DELETE"}), + BDFDB.ReactUtils.createElement("span", {children: " TO REMOVE THIS EMPTY PLUGIN FILE."}) + BDFDB.ReactUtils.createElement("strong", {children: "DELETE"}), + BDFDB.ReactUtils.createElement("span", {children: " TO REMOVE THIS EMPTY PLUGIN FILE."}) + ], + buttons: [ + {contents: "DELETE", close: true, color: "RED", onClick: _ => { + BDFDB.LibraryRequires.fs.unlink(BDFDB.LibraryRequires.path.join(BDFDB.BDUtils.getPluginsFolder(), "CreationDate.plugin.js"), error => {}); + BDFDB.LibraryRequires.fs.unlink(BDFDB.LibraryRequires.path.join(BDFDB.BDUtils.getPluginsFolder(), "CreationDate.config.json"), error => {}); + }} + ] + }); + } + + onStop () {} + }; + })(window.BDFDB_Global.PluginUtils.buildPlugin(changeLog)); +})(); diff --git a/_DEAD/JoinedAtDate.plugin.js b/_DEAD/JoinedAtDate.plugin.js new file mode 100644 index 0000000000..4164051a35 --- /dev/null +++ b/_DEAD/JoinedAtDate.plugin.js @@ -0,0 +1,74 @@ +/** + * @name JoinedAtDate + * @author DevilBro + * @authorId 278543574059057154 + * @version 9.9.9 + * @description PLUGIN WAS DISCONTINUED + */ + +module.exports = (_ => { + const changeLog = {}; + + return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class { + constructor (meta) {for (let key in meta) this[key] = meta[key];} + getName () {return this.name;} + getAuthor () {return this.author;} + getVersion () {return this.version;} + getDescription () {return `The Library Plugin needed for ${this.name} is missing. Open the Plugin Settings to download it. \n\n${this.description}`;} + + downloadLibrary () { + require("request").get("https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js", (e, r, b) => { + if (!e && b && r.statusCode == 200) require("fs").writeFile(require("path").join(BdApi.Plugins.folder, "0BDFDB.plugin.js"), b, _ => BdApi.showToast("Finished downloading BDFDB Library", {type: "success"})); + else BdApi.alert("Error", "Could not download BDFDB Library Plugin. Try again later or download it manually from GitHub: https://mwittrien.github.io/downloader/?library"); + }); + } + + load () { + if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []}); + if (!window.BDFDB_Global.downloadModal) { + window.BDFDB_Global.downloadModal = true; + BdApi.showConfirmationModal("Library Missing", `The Library Plugin needed for ${this.name} is missing. Please click "Download Now" to install it.`, { + confirmText: "Download Now", + cancelText: "Cancel", + onCancel: _ => {delete window.BDFDB_Global.downloadModal;}, + onConfirm: _ => { + delete window.BDFDB_Global.downloadModal; + this.downloadLibrary(); + } + }); + } + if (!window.BDFDB_Global.pluginQueue.includes(this.name)) window.BDFDB_Global.pluginQueue.push(this.name); + } + start () {this.load();} + stop () {} + getSettingsPanel () { + let template = document.createElement("template"); + template.innerHTML = `
The Library Plugin needed for ${this.name} is missing.\nPlease click Download Now to install it.
`; + template.content.firstElementChild.querySelector("a").addEventListener("click", this.downloadLibrary); + return template.content.firstElementChild; + } + } : (([Plugin, BDFDB]) => { + return class JoinedAtDate extends Plugin { + onLoad () {} + + onStart () { + BDFDB.ModalUtils.open(this, { + header: "PLUGIN WAS DISCONTINUED", + children: [ + BDFDB.ReactUtils.createElement("span", {children: "DISCORD ADDED THIS FEATURE BY THEMSELVES, MAKING THIS PLUGIN USELESS "}), + BDFDB.ReactUtils.createElement("strong", {children: "DELETE"}), + BDFDB.ReactUtils.createElement("span", {children: " TO REMOVE THIS EMPTY PLUGIN FILE."}) + ], + buttons: [ + {contents: "DELETE", close: true, color: "RED", onClick: _ => { + BDFDB.LibraryRequires.fs.unlink(BDFDB.LibraryRequires.path.join(BDFDB.BDUtils.getPluginsFolder(), "JoinedAtDate.plugin.js"), error => {}); + BDFDB.LibraryRequires.fs.unlink(BDFDB.LibraryRequires.path.join(BDFDB.BDUtils.getPluginsFolder(), "JoinedAtDate.config.json"), error => {}); + }} + ] + }); + } + + onStop () {} + }; + })(window.BDFDB_Global.PluginUtils.buildPlugin(changeLog)); +})();