diff --git a/package.json b/package.json index dc90a646c..ac4859593 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vencord", "private": "true", - "version": "1.9.3", + "version": "1.9.4", "description": "The cutest Discord client mod", "homepage": "https://github.com/Vendicated/Vencord#readme", "bugs": { diff --git a/src/components/VencordSettings/ThemesTab.tsx b/src/components/VencordSettings/ThemesTab.tsx index f875cb8a9..12ff57306 100644 --- a/src/components/VencordSettings/ThemesTab.tsx +++ b/src/components/VencordSettings/ThemesTab.tsx @@ -32,6 +32,8 @@ import { findByProps, findComponent } from "@webpack"; import { Card, Forms, React, showToast, TabBar, TextArea, useEffect, useRef, useState } from "@webpack/common"; import type { Ref, SyntheticEvent } from "react"; +import Plugins from "~plugins"; + import { AddonCard } from "./AddonCard"; import { QuickAction, QuickActionCard } from "./quickActions"; import { SettingsTab, wrapTab } from "./shared"; @@ -252,7 +254,7 @@ function ThemesTab() { {Vencord.Plugins.isPluginEnabled("ClientTheme") && ( openPluginModal(Vencord.Plugins.plugins.ClientTheme)} + action={() => openPluginModal(Plugins.ClientTheme)} Icon={PencilIcon} /> )} diff --git a/src/plugins/banger/index.ts b/src/plugins/banger/index.ts index 5b640be2b..eca80f9ee 100644 --- a/src/plugins/banger/index.ts +++ b/src/plugins/banger/index.ts @@ -20,26 +20,30 @@ import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; +const settings = definePluginSettings({ + source: { + description: "Source to replace ban GIF with (Video or Gif)", + type: OptionType.STRING, + default: "https://i.imgur.com/wp5q52C.mp4", + restartNeeded: true, + } +}); + export default definePlugin({ name: "BANger", description: "Replaces the GIF in the ban dialogue with a custom one.", authors: [Devs.Xinto, Devs.Glitch], + settings, patches: [ { find: "BAN_CONFIRM_TITLE.", replacement: { match: /src:\i\("?\d+"?\)/g, - replace: "src: Vencord.Settings.plugins.BANger.source" + replace: "src:$self.source" } } ], - - settings: definePluginSettings({ - source: { - description: "Source to replace ban GIF with (Video or Gif)", - type: OptionType.STRING, - default: "https://i.imgur.com/wp5q52C.mp4", - restartNeeded: true, - } - }) + get source() { + return settings.store.source; + } }); diff --git a/src/plugins/betterNotes/index.tsx b/src/plugins/betterNotes/index.tsx index e2f347b9d..88654344e 100644 --- a/src/plugins/betterNotes/index.tsx +++ b/src/plugins/betterNotes/index.tsx @@ -70,7 +70,7 @@ export default definePlugin({ find: "Messages.NOTE_PLACEHOLDER", replacement: { match: /\.NOTE_PLACEHOLDER,/, - replace: "$&spellCheck:!$self.settings.store.noSpellCheck," + replace: "$&spellCheck:!$self.noSpellCheck," } }, { @@ -87,5 +87,9 @@ export default definePlugin({ return (
); - }) + }), + + get noSpellCheck() { + return settings.store.noSpellCheck; + } }); diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx index 97b3f6f63..f2cc3e1a5 100644 --- a/src/plugins/messageLogger/index.tsx +++ b/src/plugins/messageLogger/index.tsx @@ -338,7 +338,7 @@ export default definePlugin({ // Pass through editHistory & deleted & original attachments to the "edited message" transformer match: /(?<=null!=\i\.edited_timestamp\)return )\i\(\i,\{reactions:(\i)\.reactions.{0,50}\}\)/, replace: - "Object.assign($&,{ deleted:$1.deleted, editHistory:$1.editHistory, attachments:$1.attachments })" + "Object.assign($&,{ deleted:$1.deleted, editHistory:$1.editHistory })" }, { diff --git a/src/plugins/messageLogger/messageLogger.css b/src/plugins/messageLogger/messageLogger.css index d5a9c5f17..a112b1961 100644 --- a/src/plugins/messageLogger/messageLogger.css +++ b/src/plugins/messageLogger/messageLogger.css @@ -8,11 +8,15 @@ .emoji, [data-type="sticker"], iframe, - .messagelogger-deleted-attachment:not([class*="hiddenAttachment_"]), + .messagelogger-deleted-attachment, [class|="inlineMediaEmbed"] ) { filter: grayscale(1) !important; transition: 150ms filter ease-in-out; + + &[class*="hiddenMosaicItem_"] { + filter: grayscale(1) blur(var(--custom-message-attachment-spoiler-blur-radius, 44px)) !important; + } } .messagelogger-deleted @@ -23,8 +27,7 @@ iframe, .messagelogger-deleted-attachment, [class|="inlineMediaEmbed"] -):hover, -.messagelogger-deleted { +):hover { filter: grayscale(0) !important; } diff --git a/src/plugins/urbanDictionary/README.md b/src/plugins/urbanDictionary/README.md deleted file mode 100644 index e065456a3..000000000 --- a/src/plugins/urbanDictionary/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Urban Dictionary - -Use /urban slash command to search for a definition for a word on [Urban Dictionary](https://www.urbandictionary.com/). - -## Preview - -![preview](https://i.imgur.com/1zwzj38.png) - -## Usage - -- Enable this plugin -- Set plugin settings as desired -- Type /urban and start getting definitions right into your Discord client. diff --git a/src/plugins/urbanDictionary/index.ts b/src/plugins/urbanDictionary/index.ts deleted file mode 100644 index 89dcdcba4..000000000 --- a/src/plugins/urbanDictionary/index.ts +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Vencord, a modification for Discord's desktop app - * Copyright (c) 2022 Vendicated and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ - -import { ApplicationCommandOptionType, sendBotMessage } from "@api/Commands"; -import { ApplicationCommandInputType } from "@api/Commands/types"; -import { definePluginSettings } from "@api/Settings"; -import { Devs } from "@utils/constants"; -import definePlugin, { OptionType } from "@utils/types"; - -const settings = definePluginSettings({ - resultsAmount: { - type: OptionType.NUMBER, - description: "The amount of results you want to get (more gives better results, but is slower)", - default: 10 - } -}); - -export default definePlugin({ - name: "UrbanDictionary", - description: "Search for a word on Urban Dictionary via /urban slash command", - authors: [Devs.jewdev], - dependencies: ["CommandsAPI"], - settings, - commands: [ - { - name: "urban", - description: "Returns the definition of a word from Urban Dictionary", - inputType: ApplicationCommandInputType.BUILT_IN, - options: [ - { - type: ApplicationCommandOptionType.STRING, - name: "word", - description: "The word to search for on Urban Dictionary", - required: true - } - ], - execute: async (args, ctx) => { - try { - const query: string = encodeURIComponent(args[0].value); - const { list } = await fetch(`https://api.urbandictionary.com/v0/define?term=${query}&per_page=${settings.store.resultsAmount}`).then(response => response.json()); - - if (!list.length) - return void sendBotMessage(ctx.channel.id, { content: "No results found." }); - - const definition = list.reduce((prev, curr) => { - return prev.thumbs_up > curr.thumbs_up ? prev : curr; - }); - - const linkify = (text: string) => text - .replaceAll("\r\n", "\n") - .replace(/([*>_`~\\])/gsi, "\\$1") - .replace(/\[(.+?)\]/g, (_, word) => `[${word}](https://www.urbandictionary.com/define.php?term=${encodeURIComponent(word)} "Define '${word}' on Urban Dictionary")`) - .trim(); - - return void sendBotMessage(ctx.channel.id, { - embeds: [ - { - type: "rich", - author: { - name: `Uploaded by "${definition.author}"`, - url: `https://www.urbandictionary.com/author.php?author=${encodeURIComponent(definition.author)}`, - }, - title: definition.word, - url: `https://www.urbandictionary.com/define.php?term=${encodeURIComponent(definition.word)}`, - description: linkify(definition.definition), - fields: [ - { - name: "Example", - value: linkify(definition.example), - }, - { - name: "Want more definitions?", - value: `Check out [more definitions](https://www.urbandictionary.com/define.php?term=${query} "Define "${args[0].value}" on Urban Dictionary") on Urban Dictionary.`, - }, - ], - color: 0xFF9900, - footer: { text: `👍 ${definition.thumbs_up.toString()} | 👎 ${definition.thumbs_down.toString()}`, icon_url: "https://www.urbandictionary.com/favicon.ico" }, - timestamp: new Date(definition.written_on).toISOString(), - }, - ] as any, - }); - } catch (error) { - sendBotMessage(ctx.channel.id, { - content: `Something went wrong: \`${error}\``, - }); - } - } - } - ] -}); diff --git a/src/plugins/wikisearch/index.ts b/src/plugins/wikisearch/index.ts deleted file mode 100644 index 81dc37af1..000000000 --- a/src/plugins/wikisearch/index.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Vencord, a modification for Discord's desktop app - * Copyright (c) 2023 Vendicated and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ - -import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from "@api/Commands"; -import { Devs } from "@utils/constants"; -import definePlugin from "@utils/types"; - -export default definePlugin({ - name: "Wikisearch", - description: "Searches Wikipedia for your requested query. (/wikisearch)", - authors: [Devs.Samu], - dependencies: ["CommandsAPI"], - commands: [ - { - name: "wikisearch", - description: "Searches Wikipedia for your request.", - inputType: ApplicationCommandInputType.BUILT_IN, - options: [ - { - name: "search", - description: "Word to search for", - type: ApplicationCommandOptionType.STRING, - required: true - }, - ], - execute: async (_, ctx) => { - const word = findOption(_, "search", ""); - - if (!word) { - return sendBotMessage(ctx.channel.id, { - content: "No word was defined!" - }); - } - - const dataSearchParams = new URLSearchParams({ - action: "query", - format: "json", - list: "search", - formatversion: "2", - origin: "*", - srsearch: word - }); - - const data = await fetch("https://en.wikipedia.org/w/api.php?" + dataSearchParams).then(response => response.json()) - .catch(err => { - console.log(err); - sendBotMessage(ctx.channel.id, { content: "There was an error. Check the console for more info" }); - return null; - }); - - if (!data) return; - - if (!data.query?.search?.length) { - console.log(data); - return sendBotMessage(ctx.channel.id, { content: "No results given" }); - } - - const altData = await fetch(`https://en.wikipedia.org/w/api.php?action=query&format=json&prop=info%7Cdescription%7Cimages%7Cimageinfo%7Cpageimages&list=&meta=&indexpageids=1&pageids=${data.query.search[0].pageid}&formatversion=2&origin=*`) - .then(res => res.json()) - .then(data => data.query.pages[0]) - .catch(err => { - console.log(err); - sendBotMessage(ctx.channel.id, { content: "There was an error. Check the console for more info" }); - return null; - }); - - if (!altData) return; - - const thumbnailData = altData.thumbnail; - - const thumbnail = thumbnailData && { - url: thumbnailData.source.replace(/(50px-)/ig, "1000px-"), - height: thumbnailData.height * 100, - width: thumbnailData.width * 100 - }; - - sendBotMessage(ctx.channel.id, { - embeds: [ - { - type: "rich", - title: data.query.search[0].title, - url: `https://wikipedia.org/w/index.php?curid=${data.query.search[0].pageid}`, - color: "0x8663BE", - description: data.query.search[0].snippet.replace(/( |<([^>]+)>)/ig, "").replace(/(")/ig, "\"") + "...", - image: thumbnail, - footer: { - text: "Powered by the Wikimedia API", - }, - } - ] as any - }); - } - } - ] -});