diff --git a/src/equicordplugins/anammox/index.ts b/src/equicordplugins/anammox/index.ts index 275aaedf3..0fc1001ee 100644 --- a/src/equicordplugins/anammox/index.ts +++ b/src/equicordplugins/anammox/index.ts @@ -1,6 +1,6 @@ /* * Vencord, a Discord client mod - * Copyright (c) 2024 Vendicated and contributors + * Copyright (c) 2025 Vendicated and contributors * SPDX-License-Identifier: GPL-3.0-or-later */ @@ -15,6 +15,12 @@ export const settings = definePluginSettings({ description: "Remove shops above DMs list", restartNeeded: true, }, + serverBoost: { + type: OptionType.BOOLEAN, + default: true, + description: "Remove server boost info above channel list", + restartNeeded: true, + }, billing: { type: OptionType.BOOLEAN, default: true, @@ -27,6 +33,12 @@ export const settings = definePluginSettings({ description: "Remove gift button", restartNeeded: true, }, + gif: { + type: OptionType.BOOLEAN, + default: false, + description: "Remove gif and sticker buttons", + restartNeeded: true, + }, emojiList: { type: OptionType.BOOLEAN, default: true, @@ -72,12 +84,21 @@ export default definePlugin({ ], predicate: () => settings.store.dms, }, + { + // Channel list server boost progress bar + find: "useGuildActionRow", + replacement: { + match: /\i\.premiumProgressBarEnabled&&[^,]+/, + replace: "null" + }, + predicate: () => settings.store.serverBoost, + }, { // Settings, sidebar find: "#{intl::BILLING_SETTINGS}", replacement: [ { - match: /(?<=#{intl::BILLING_SETTINGS}\),)/, + match: /(?<=#{intl::BILLING_SETTINGS}[^,]*?,)(?=div)/, replace: "capitalism:true," }, { @@ -89,20 +110,25 @@ export default definePlugin({ }, { // Gift button - find: "GIFT_BUTTON)", - replacement: { - match: /if\(\i\)return null;/, - replace: "return null;", - }, - all: true, + find: '"sticker")', + replacement: { match: /&&\i\.push\(\([^&]*?,"gift"\)\)/, replace: "", }, predicate: () => settings.store.gift, }, + { + // Gif and sticker buttons + find: '"sticker")', + replacement: [ + { match: /&&\i\.push\([^&]*?,"gif"\)\)/, replace: "", }, + { match: /&&\i\.push\([^&]*?,"sticker"\)\)/, replace: "", }, + ], + predicate: () => settings.store.gif, + }, { // Emoji list find: "#{intl::EMOJI_PICKER_CREATE_EMOJI_TITLE}),size:", replacement: { match: /(\i)=\i\|\|!\i&&\i.\i.isEmojiCategoryNitroLocked\(\{[^}]*\}\);/, - replace: "$&$1=($1 && $1.isNitroLocked && !$1.isUserAccess);" + replace: "$&$1||" }, predicate: () => settings.store.emojiList, }, @@ -111,7 +137,7 @@ export default definePlugin({ find: "#{intl::EMOJI_CATEGORY_TOP_GUILD_EMOJI},{guildName:", replacement: { match: /(?<=(\i)\.unshift\((\i)\):)(?=\1\.push\(\2\))/, - replace: "$2.isNitroLocked && !$2.isUserAccess ||" + replace: "$2.isNitroLocked||" }, predicate: () => settings.store.emojiList, } diff --git a/src/equicordplugins/dontFilterMe/index.tsx b/src/equicordplugins/dontFilterMe/index.tsx index aec78e046..1f473bc72 100644 --- a/src/equicordplugins/dontFilterMe/index.tsx +++ b/src/equicordplugins/dontFilterMe/index.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { addMessagePreSendListener } from "@api/MessageEvents"; +import { addMessagePreSendListener, removeMessagePreSendListener } from "@api/MessageEvents"; import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; import { Alerts, ChannelStore, Forms, PermissionsBits, PermissionStore } from "@webpack/common"; @@ -35,29 +35,35 @@ function warningEmbedNotice(trigger) { }); } +const handleMessage = async (channelId, messageObj) => { + const channel = ChannelStore.getChannel(channelId); + if (channel.isDM()) return { cancel: false }; + if (PermissionStore.can(PermissionsBits.ADMINISTRATOR, channel) || PermissionStore.can(PermissionsBits.MANAGE_GUILD, channel)) return { cancel: false }; + + const escapedStrings = filterList.map(escapeRegex); + const regexString = escapedStrings.join("|"); + const regex = new RegExp(`(${regexString})`, "i"); + + const matches = regex.exec(messageObj.content); + console.log(matches); + if (matches) { + if (!await warningEmbedNotice(matches[0])) { + return { cancel: true }; + } + } + + return { cancel: false }; +}; + export default definePlugin({ name: "DontFilterMe", description: "Warns you if your message contains a term in the automod preset list", authors: [Devs.Samwich], dependencies: ["MessageEventsAPI"], start() { - this.preSend = addMessagePreSendListener(async (channelId, messageObj) => { - const channel = ChannelStore.getChannel(channelId); - if (channel.isDM()) return { cancel: false }; - if (PermissionStore.can(PermissionsBits.ADMINISTRATOR, channel) || PermissionStore.can(PermissionsBits.MANAGE_GUILD, channel)) return { cancel: false }; - - const escapedStrings = filterList.map(escapeRegex); - const regexString = escapedStrings.join("|"); - const regex = new RegExp(`(${regexString})`, "i"); - - const matches = regex.exec(messageObj.content); - if (matches) { - if (!await warningEmbedNotice(matches[0])) { - return { cancel: true }; - } - } - - return { cancel: false }; - }); + addMessagePreSendListener(handleMessage); + }, + stop() { + removeMessagePreSendListener(handleMessage); } }); diff --git a/src/equicordplugins/holyNotes/NoteHandler.ts b/src/equicordplugins/holyNotes/NoteHandler.ts index ff929f81d..a501b9852 100644 --- a/src/equicordplugins/holyNotes/NoteHandler.ts +++ b/src/equicordplugins/holyNotes/NoteHandler.ts @@ -14,7 +14,7 @@ import { deleteCacheFromDataStore, DeleteEntireStore, saveCacheToDataStore } fro export const noteHandlerCache = new Map(); export default new (class NoteHandler { - public _formatNote(channel: Channel, message: Message): HolyNotes.Note { + private _formatNote(channel: Channel, message: Message): HolyNotes.Note { return { id: message.id, channel_id: message.channel_id, diff --git a/src/equicordplugins/holyNotes/components/modals/HelpModal.tsx b/src/equicordplugins/holyNotes/components/modals/HelpModal.tsx index 508273171..ca4e29961 100644 --- a/src/equicordplugins/holyNotes/components/modals/HelpModal.tsx +++ b/src/equicordplugins/holyNotes/components/modals/HelpModal.tsx @@ -12,7 +12,7 @@ import noteHandler from "../../NoteHandler"; import { downloadNotes, uploadNotes } from "../../utils"; export default ({ onClose, ...modalProps }: ModalProps & { onClose: () => void; }) => { - const { colorStatusGreen } = findByProps("colorStatusGreen"); + const { statusTagGreen } = findByProps("statusTagGreen"); return ( @@ -28,7 +28,7 @@ export default ({ onClose, ...modalProps }: ModalProps & { onClose: () => void;
the button with the notebook name you would like to note the message to.
- + Protip: {" "} Clicking the "Note Message" button by itself will note to Main by default! @@ -72,7 +72,7 @@ export default ({ onClose, ...modalProps }: ModalProps & { onClose: () => void;