merge more plugins

This commit is contained in:
thororen1234 2026-03-07 00:34:23 -05:00
parent 6ca466b6a5
commit a62d41de64
No known key found for this signature in database
8 changed files with 122 additions and 111 deletions

View file

@ -6,8 +6,9 @@
import { ApplicationCommandInputType, sendBotMessage } from "@api/Commands";
import { HeaderBarButton } from "@api/HeaderBar";
import { addMessagePreSendListener, removeMessagePreSendListener } from "@api/MessageEvents";
import { isPluginEnabled } from "@api/PluginManager";
import { definePluginSettings } from "@api/Settings";
import { definePluginSettings, migratePluginToSettings } from "@api/Settings";
import customRPC from "@plugins/customRPC";
import { Devs, EquicordDevs, GUILD_ID, SUPPORT_CHANNEL_ID, SUPPORT_CHANNEL_IDS, VC_SUPPORT_CHANNEL_IDS } from "@utils/constants";
import { isAnyPluginDev } from "@utils/misc";
@ -20,6 +21,9 @@ import { ComponentType } from "react";
import { PluginButtons } from "./pluginButtons";
import { PluginCards } from "./pluginCards";
migratePluginToSettings(true, "EquicordHelper", "NoBulletPoints", "noBulletPoints");
migratePluginToSettings(true, "EquicordHelper", "NoModalAnimation", "noModalAnimation");
let clicked = false;
const SafetyHubStore = findStoreLazy("SafetyHubStore");
@ -58,6 +62,11 @@ function StandingButton() {
);
}
const listener = async (channelId, msg) => {
if (!settings.store.noBulletPoints) return;
msg.content = textProcessing(msg.content);
};
const settings = definePluginSettings({
noMirroredCamera: {
type: OptionType.BOOLEAN,
@ -106,12 +115,34 @@ const settings = definePluginSettings({
restartNeeded: true,
default: false
},
noBulletPoints: {
type: OptionType.BOOLEAN,
description: "Stops you from typing markdown bullet points (stinky)",
restartNeeded: true,
default: false
},
noModalAnimation: {
type: OptionType.BOOLEAN,
description: "Remove the 300ms long animation when opening or closing modals",
restartNeeded: true,
default: false
},
});
export default definePlugin({
name: "EquicordHelper",
description: "Used to provide support, fix discord caused crashes, and other misc features.",
authors: [Devs.thororen, EquicordDevs.nyx, EquicordDevs.Naibuu, EquicordDevs.keircn, EquicordDevs.SerStars, EquicordDevs.mart, EquicordDevs.omaw],
authors: [
Devs.thororen,
EquicordDevs.nyx,
EquicordDevs.Naibuu,
EquicordDevs.keircn,
EquicordDevs.SerStars,
EquicordDevs.mart,
EquicordDevs.omaw,
Devs.Samwich,
Devs.AutumnVN
],
required: true,
settings,
headerBarButton: {
@ -199,13 +230,49 @@ export default definePlugin({
},
// Restore File Download Button
{
predicate: () => settings.store.restoreFileDownloadButton,
find: '"VISUAL_PLACEHOLDER":',
predicate: () => settings.store.restoreFileDownloadButton,
replacement: {
match: /(\.downloadUrl,showDownload:)\i/,
replace: "$1!0"
}
},
// Removes Modal Animation
{
find: "DURATION_IN:",
predicate: () => settings.store.noModalAnimation,
replacement: {
match: /300,/,
replace: "0,",
}
},
// Removes Modal Animation
{
find: 'backdropFilter:"blur(0px)"',
predicate: () => settings.store.noModalAnimation,
replacement: {
match: /\?0:200/,
replace: "?0:0",
}
},
// Removes Modal Animation
{
find: '="ABOVE"',
predicate: () => settings.store.noModalAnimation,
replacement: {
match: /\?\?300/,
replace: "??0",
}
},
// Removes Modal Animation
{
find: "renderLurkerModeUpsellPopout,position:",
predicate: () => settings.store.noModalAnimation,
replacement: {
match: /200:300/g,
replace: "0:0",
},
}
],
renderMessageAccessory(props) {
return (
@ -255,5 +322,19 @@ export default definePlugin({
}
}
}
]
],
start() {
if (settings.store.noBulletPoints) {
addMessagePreSendListener(listener);
}
},
stop() {
if (settings.store.noBulletPoints) {
removeMessagePreSendListener(listener);
}
}
});
function textProcessing(text: string): string {
return text.replace(/(^|\n)(\s*)([*+-])\s+/g, "$1$2\\$3 ");
}

View file

@ -6,6 +6,7 @@
import "./styles.css";
import { migratePluginToSettings } from "@api/Settings";
import { Devs, EquicordDevs } from "@utils/constants";
import { classNameFactory } from "@utils/css";
import { getCurrentChannel, getIntlMessage } from "@utils/discord";
@ -31,10 +32,12 @@ const genTagTypes = () => {
return obj;
};
migratePluginToSettings(true, "MoreUserTags", "NoAppsAllowed", "noAppsAllowed");
export default definePlugin({
name: "MoreUserTags",
description: "Adds tags for webhooks and moderative roles (owner, admin, etc.)",
authors: [Devs.Cyn, Devs.TheSun, Devs.RyanCaoDev, Devs.LordElias, Devs.AutumnVN, EquicordDevs.Hen],
authors: [Devs.Cyn, Devs.TheSun, Devs.RyanCaoDev, Devs.LordElias, Devs.AutumnVN, EquicordDevs.Hen, EquicordDevs.meowabyte],
settings,
patches: [
// Make discord actually use our tags
@ -51,6 +54,14 @@ export default definePlugin({
predicate: () => settings.store.dontShowBotTag
},
],
},
{
find: '"#{intl::APP_TAG::hash}":',
predicate: () => settings.store.noAppsAllowed,
replacement: {
match: /(#{intl::APP_TAG::hash}":\[").*?("\])/,
replace: "$1BOT$2"
}
}
],
start() {

View file

@ -115,4 +115,10 @@ export const settings = definePluginSettings({
component: SettingsComponent,
description: "fill me"
},
noAppsAllowed: {
description: "Replaces app for bot",
type: OptionType.BOOLEAN,
default: false,
restartNeeded: true
}
});

View file

@ -1,23 +0,0 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2023 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { EquicordDevs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "NoAppsAllowed",
description: "returns the bot's tag :skulk:",
authors: [EquicordDevs.meowabyte],
patches: [
{
find: '"#{intl::APP_TAG::hash}":',
replacement: {
match: /(#{intl::APP_TAG::hash}":\[").*?("\])/,
replace: "$1BOT$2"
}
}
]
});

View file

@ -1,20 +0,0 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "NoBulletPoints",
description: "Stops you from typing markdown bullet points (stinky)",
authors: [Devs.Samwich],
onBeforeMessageSend(channelId, msg) {
msg.content = textProcessing(msg.content);
},
});
function textProcessing(text: string): string {
return text.replace(/(^|\n)(\s*)([*+-])\s+/g, "$1$2\\$3 ");
}

View file

@ -1,44 +0,0 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "NoModalAnimation",
description: "Remove the 300ms long animation when opening or closing modals",
authors: [Devs.AutumnVN],
patches: [
{
find: "DURATION_IN:",
replacement: {
match: /300,/,
replace: "0,",
}
},
{
find: 'backdropFilter:"blur(0px)"',
replacement: {
match: /\?0:200/,
replace: "?0:0",
}
},
{
find: '="ABOVE"',
replacement: {
match: /\?\?300/,
replace: "??0",
}
},
{
find: "renderLurkerModeUpsellPopout,position:",
replacement: {
match: /200:300/g,
replace: "0:0",
},
}
]
});

View file

@ -1,14 +0,0 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2023 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "FixYoutubeEmbeds",
description: "Bypasses youtube videos being blocked from display on Discord (for example by UMG)",
authors: [Devs.coolelectronics]
});

View file

@ -1,24 +1,38 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* Copyright (c) 2023 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { definePluginSettings, migratePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import definePlugin, { OptionType } from "@utils/types";
import { Embed } from "@vencord/discord-types";
import { useState } from "@webpack/common";
interface ToggleableDescriptionProps { embed: Embed, original: () => any; }
const settings = definePluginSettings({
youtubeDescription: {
description: "Adds descriptions to youtube video embeds",
type: OptionType.BOOLEAN,
default: false,
restartNeeded: true
}
});
migratePluginSettings("FixYoutubeEmbeds", "YoutubeDescription");
export default definePlugin({
name: "YoutubeDescription",
description: "Adds descriptions to youtube video embeds",
authors: [Devs.arHSM],
name: "FixYoutubeEmbeds",
description: "Bypasses youtube videos being blocked from display on Discord (for example by UMG)",
authors: [Devs.coolelectronics, Devs.arHSM],
settings,
patches: [
{
find: "#{intl::SUPPRESS_ALL_EMBEDS}",
predicate: () => settings.store.youtubeDescription,
replacement: {
match: /case (\i\.\i\.VIDEO):(case \i\.\i\.\i:)*break;default:(\i)=(?:(this\.renderDescription)\(\))\}/,
replace: "$2 break; case $1: $3 = $self.ToggleableDescriptionWrapper({ embed: this.props.embed, original: $4.bind(this) }); break; default: $3 = $4() }"