;
28 | }
29 |
--------------------------------------------------------------------------------
/.github/workflows/test.yml:
--------------------------------------------------------------------------------
1 | name: test
2 | on:
3 | push:
4 | pull_request:
5 | branches:
6 | - main
7 | - dev
8 | jobs:
9 | test:
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - uses: actions/checkout@v4
14 | - uses: pnpm/action-setup@v3 # Install pnpm using packageManager key in package.json
15 |
16 | - name: Use Node.js 20
17 | uses: actions/setup-node@v4
18 | with:
19 | node-version: 20
20 | cache: "pnpm"
21 |
22 | - name: Install dependencies
23 | run: pnpm install --frozen-lockfile
24 |
25 | - name: Lint & Test if desktop version compiles
26 | run: pnpm test
27 |
28 | - name: Test if web version compiles
29 | run: pnpm buildWeb
30 |
31 | - name: Test if plugin structure is valid
32 | run: pnpm generatePluginJson
33 |
--------------------------------------------------------------------------------
/packages/discord-types/src/common/messages/Sticker.d.ts:
--------------------------------------------------------------------------------
1 | import { StickerFormatType, StickerType } from "../../../enums";
2 |
3 | interface BaseSticker {
4 | asset: string;
5 | available: boolean;
6 | description: string;
7 | format_type: StickerFormatType;
8 | id: string;
9 | name: string;
10 | sort_value?: number;
11 | /** a comma separated string */
12 | tags: string;
13 | }
14 |
15 | export interface PackSticker extends BaseSticker {
16 | pack_id: string;
17 | type: StickerType.STANDARD;
18 | }
19 |
20 | export interface GuildSticker extends BaseSticker {
21 | guild_id: string;
22 | type: StickerType.GUILD;
23 | }
24 |
25 | export type Sticker = PackSticker | GuildSticker;
26 |
27 | export interface PremiumStickerPack {
28 | banner_asset_id?: string;
29 | cover_sticker_id?: string;
30 | description: string;
31 | id: string;
32 | name: string;
33 | sku_id: string;
34 | stickers: PackSticker[];
35 | }
36 |
--------------------------------------------------------------------------------
/src/plugins/decor/README.md:
--------------------------------------------------------------------------------
1 | # Decor
2 |
3 | Custom avatar decorations!
4 |
5 | 
6 |
7 | Create and use your own custom avatar decorations, or pick your favorite from the presets.
8 |
9 | You'll be able to see the custom avatar decorations of other users of this plugin, and they'll be able to see your custom avatar decoration.
10 |
11 | You can select and manage your custom avatar decorations under the "Profiles" page in settings, or in the plugin settings.
12 |
13 | 
14 |
15 | Review the [guidelines](https://github.com/decor-discord/.github/blob/main/GUIDELINES.md) before creating your own custom avatar decoration.
16 |
17 | Join the [Discord server](https://discord.gg/dXp2SdxDcP) for support and notifications on your decoration's review.
18 |
--------------------------------------------------------------------------------
/src/plugins/decor/ui/components/DecorationGridCreate.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2023 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { PlusIcon } from "@components/Icons";
8 | import { getIntlMessage } from "@utils/discord";
9 | import { Text } from "@webpack/common";
10 | import { HTMLProps } from "react";
11 |
12 | import { DecorationGridItem } from ".";
13 |
14 | type DecorationGridCreateProps = HTMLProps & {
15 | onSelect: () => void;
16 | };
17 |
18 | export default function DecorationGridCreate(props: DecorationGridCreateProps) {
19 | return
23 |
24 |
28 | {getIntlMessage("CREATE")}
29 |
30 | ;
31 | }
32 |
--------------------------------------------------------------------------------
/src/plugins/decor/ui/components/DecorationGridNone.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2023 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { NoEntrySignIcon } from "@components/Icons";
8 | import { getIntlMessage } from "@utils/discord";
9 | import { Text } from "@webpack/common";
10 | import { HTMLProps } from "react";
11 |
12 | import { DecorationGridItem } from ".";
13 |
14 | type DecorationGridNoneProps = HTMLProps & {
15 | isSelected: boolean;
16 | onSelect: () => void;
17 | };
18 |
19 | export default function DecorationGridNone(props: DecorationGridNoneProps) {
20 | return
23 |
24 |
28 | {getIntlMessage("NONE")}
29 |
30 | ;
31 | }
32 |
--------------------------------------------------------------------------------
/src/plugins/translate/native.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2024 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { IpcMainInvokeEvent } from "electron";
8 |
9 | export async function makeDeeplTranslateRequest(_: IpcMainInvokeEvent, pro: boolean, apiKey: string, payload: string) {
10 | const url = pro
11 | ? "https://api.deepl.com/v2/translate"
12 | : "https://api-free.deepl.com/v2/translate";
13 |
14 | try {
15 | const res = await fetch(url, {
16 | method: "POST",
17 | headers: {
18 | "Content-Type": "application/json",
19 | "Authorization": `DeepL-Auth-Key ${apiKey}`
20 | },
21 | body: payload
22 | });
23 |
24 | const data = await res.text();
25 | return { status: res.status, data };
26 | } catch (e) {
27 | return { status: -1, data: String(e) };
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/packages/discord-types/src/common/Role.d.ts:
--------------------------------------------------------------------------------
1 | export interface Role {
2 | color: number;
3 | colorString: string | undefined;
4 | colorStrings: {
5 | primaryColor: string | undefined;
6 | secondaryColor: string | undefined;
7 | tertiaryColor: string | undefined;
8 | };
9 | colors: {
10 | primary_color: number | undefined;
11 | secondary_color: number | undefined;
12 | tertiary_color: number | undefined;
13 | };
14 | flags: number;
15 | hoist: boolean;
16 | icon: string | undefined;
17 | id: string;
18 | managed: boolean;
19 | mentionable: boolean;
20 | name: string;
21 | originalPosition: number;
22 | permissions: bigint;
23 | position: number;
24 | /**
25 | * probably incomplete
26 | */
27 | tags: {
28 | bot_id: string;
29 | integration_id: string;
30 | premium_subscriber: unknown;
31 | } | undefined;
32 | unicodeEmoji: string | undefined;
33 | }
34 |
--------------------------------------------------------------------------------
/packages/vencord-types/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@vencord/types",
3 | "private": false,
4 | "version": "1.13.2",
5 | "description": "",
6 | "types": "index.d.ts",
7 | "scripts": {
8 | "prepublishOnly": "tsx ./prepare.ts",
9 | "test": "echo \"Error: no test specified\" && exit 1"
10 | },
11 | "keywords": [],
12 | "author": "Vencord",
13 | "license": "GPL-3.0",
14 | "devDependencies": {
15 | "@types/fs-extra": "^11.0.4",
16 | "fs-extra": "^11.3.0",
17 | "tsx": "^4.19.2"
18 | },
19 | "dependencies": {
20 | "@types/lodash": "4.17.15",
21 | "@types/node": "^22.13.4",
22 | "@vencord/discord-types": "^1.0.0",
23 | "highlight.js": "11.11.1",
24 | "moment": "^2.22.2",
25 | "ts-pattern": "^5.6.0",
26 | "type-fest": "^4.35.0"
27 | },
28 | "peerDependencies": {
29 | "@types/react": "18.3.1",
30 | "@types/react-dom": "18.3.1"
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/plugins/fixSpotifyEmbeds.desktop/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2023 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { definePluginSettings } from "@api/Settings";
8 | import { Devs } from "@utils/constants";
9 | import definePlugin, { makeRange, OptionType } from "@utils/types";
10 |
11 | // The entire code of this plugin can be found in ipcPlugins
12 | export default definePlugin({
13 | name: "FixSpotifyEmbeds",
14 | description: "Fixes spotify embeds being incredibly loud by letting you customise the volume",
15 | authors: [Devs.Ven],
16 | settings: definePluginSettings({
17 | volume: {
18 | type: OptionType.SLIDER,
19 | description: "The volume % to set for spotify embeds. Anything above 10% is veeeery loud",
20 | markers: makeRange(0, 100, 10),
21 | stickToMarkers: false,
22 | default: 10
23 | }
24 | })
25 | });
26 |
--------------------------------------------------------------------------------
/src/plugins/spotifyControls/SeekBar.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2025 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { LazyComponent } from "@utils/lazyReact";
8 | import { Slider } from "@webpack/common";
9 |
10 | export const SeekBar = LazyComponent(() => {
11 | const SliderClass = Slider.$$vencordGetWrappedComponent();
12 |
13 | // Discord's Slider does not update `state.value` when `props.initialValue` changes if state.value is not nullish.
14 | // We extend their class and override their `getDerivedStateFromProps` to update the value
15 | return class SeekBar extends SliderClass {
16 | static getDerivedStateFromProps(props: any, state: any) {
17 | const newState = super.getDerivedStateFromProps!(props, state);
18 | if (newState) {
19 | newState.value = props.initialValue;
20 | }
21 |
22 | return newState;
23 | }
24 | };
25 | });
26 |
--------------------------------------------------------------------------------
/src/plugins/imageZoom/utils/waitFor.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2023 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | export function waitFor(condition: () => boolean, cb: () => void) {
20 | if (condition()) cb();
21 | else requestAnimationFrame(() => waitFor(condition, cb));
22 | }
23 |
--------------------------------------------------------------------------------
/packages/vencord-types/globals.d.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | declare global {
20 | export var VencordNative: typeof import("./VencordNative").default;
21 | export var Vencord: typeof import("./Vencord");
22 | }
23 |
24 | export { };
25 |
--------------------------------------------------------------------------------
/scripts/checkNodeVersion.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2023 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | if (Number(process.versions.node.split(".")[0]) < 18)
20 | throw `Your node version (${process.version}) is too old, please update to v18 or higher https://nodejs.org/en/download/`;
21 |
--------------------------------------------------------------------------------
/src/plugins/openInApp/native.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2023 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { IpcMainInvokeEvent } from "electron";
8 | import { request } from "https";
9 |
10 | // These links don't support CORS, so this has to be native
11 | const validRedirectUrls = /^https:\/\/(spotify\.link|s\.team)\/.+$/;
12 |
13 | function getRedirect(url: string) {
14 | return new Promise((resolve, reject) => {
15 | const req = request(new URL(url), { method: "HEAD" }, res => {
16 | resolve(
17 | res.headers.location
18 | ? getRedirect(res.headers.location)
19 | : url
20 | );
21 | });
22 | req.on("error", reject);
23 | req.end();
24 | });
25 | }
26 |
27 | export async function resolveRedirect(_: IpcMainInvokeEvent, url: string) {
28 | if (!validRedirectUrls.test(url)) return url;
29 |
30 | return getRedirect(url);
31 | }
32 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/blank.yml:
--------------------------------------------------------------------------------
1 | name: Blank Issue
2 | description: Create a blank issue. ALWAYS FIRST USE OUR SUPPORT CHANNEL! ONLY USE THIS FORM IF YOU ARE A CONTRIBUTOR OR WERE TOLD TO DO SO IN THE SUPPORT CHANNEL.
3 |
4 | body:
5 | - type: markdown
6 | attributes:
7 | value: |
8 | 
9 |
10 | GitHub Issues are for development, not support! Please use our [support server](https://vencord.dev/discord) unless you are a Vencord Developer.
11 |
12 | - type: textarea
13 | id: content
14 | attributes:
15 | label: Content
16 | validations:
17 | required: true
18 |
19 | - type: checkboxes
20 | id: agreement-check
21 | attributes:
22 | label: Request Agreement
23 | options:
24 | - label: I have read the requirements for opening an issue above
25 | required: true
26 |
--------------------------------------------------------------------------------
/scripts/build/module/style.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | (window.VencordStyles ??= new Map()).set(STYLE_NAME, {
20 | name: STYLE_NAME,
21 | source: STYLE_SOURCE,
22 | classNames: {},
23 | dom: null,
24 | });
25 |
26 | export default STYLE_NAME;
27 |
--------------------------------------------------------------------------------
/scripts/build/inject/react.mjs:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | export const VencordFragment = /* #__PURE__*/ Symbol.for("react.fragment");
20 | export let VencordCreateElement =
21 | (...args) => (VencordCreateElement = Vencord.Webpack.Common.React.createElement)(...args);
22 |
--------------------------------------------------------------------------------
/src/webpack/common/classes.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2023 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | import * as t from "@vencord/discord-types";
20 | import { findByPropsLazy } from "@webpack";
21 |
22 | export const ButtonWrapperClasses: t.ButtonWrapperClasses = findByPropsLazy("buttonWrapper", "buttonContent");
23 |
--------------------------------------------------------------------------------
/src/webpack/common/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2023 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | export * from "./classes";
20 | export * from "./components";
21 | export * from "./menu";
22 | export * from "./react";
23 | export * from "./stores";
24 | export * from "./userSettings";
25 | export * from "./utils";
26 |
--------------------------------------------------------------------------------
/src/plugins/voiceMessages/utils.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2023 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | import { classNameFactory } from "@api/Styles";
20 | import { findStoreLazy } from "@webpack";
21 |
22 | export const MediaEngineStore = findStoreLazy("MediaEngineStore");
23 | export const cl = classNameFactory("vc-vmsg-");
24 |
--------------------------------------------------------------------------------
/src/utils/native.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2023 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | export function relaunch() {
20 | if (IS_DISCORD_DESKTOP)
21 | window.DiscordNative.app.relaunch();
22 | else if (IS_VESKTOP)
23 | window.VesktopNative.app.relaunch();
24 | else
25 | location.reload();
26 | }
27 |
--------------------------------------------------------------------------------
/src/plugins/messageLatency/README.md:
--------------------------------------------------------------------------------
1 | # MessageLatency
2 |
3 | Displays an indicator for messages that took ≥n seconds to send.
4 |
5 | > **NOTE**
6 | >
7 | > - This plugin only applies to messages received after opening the channel
8 | > - False positives can exist if the user's system clock has drifted.
9 | > - Grouped messages only display latency of the first message
10 |
11 | ## Demo
12 |
13 | ### Chat View
14 |
15 | 
16 |
17 | ### Clock -ve Drift
18 |
19 | 
20 |
21 | ### Clock +ve Drift
22 |
23 | 
24 |
25 | ### Connection Delay
26 |
27 | 
28 |
29 | ### Icons
30 |
31 | 
32 |
--------------------------------------------------------------------------------
/scripts/suppressExperimentalWarnings.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | process.emit = (originalEmit => function (name, data) {
20 | if (name === "warning" && data?.name === "ExperimentalWarning")
21 | return false;
22 |
23 | return originalEmit.apply(process, arguments);
24 | })(process.emit);
25 |
--------------------------------------------------------------------------------
/src/utils/guards.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2023 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | export function isTruthy(item: T): item is Exclude {
20 | return Boolean(item);
21 | }
22 |
23 | export function isNonNullish(item: T): item is Exclude {
24 | return item != null;
25 | }
26 |
--------------------------------------------------------------------------------
/src/plugins/betterSessions/components/RenameButton.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2024 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { Button } from "@components/Button";
8 | import { SessionInfo } from "@plugins/betterSessions/types";
9 | import { openModal } from "@utils/modal";
10 |
11 | import { RenameModal } from "./RenameModal";
12 |
13 | export function RenameButton({ session, state }: { session: SessionInfo["session"], state: [string, React.Dispatch>]; }) {
14 | return (
15 |
31 | );
32 | }
33 |
--------------------------------------------------------------------------------
/src/plugins/fixYoutubeEmbeds.desktop/native.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2023 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { RendererSettings } from "@main/settings";
8 | import { app } from "electron";
9 |
10 | app.on("browser-window-created", (_, win) => {
11 | win.webContents.on("frame-created", (_, { frame }) => {
12 | frame?.once("dom-ready", () => {
13 | if (frame.url.startsWith("https://www.youtube.com/")) {
14 | const settings = RendererSettings.store.plugins?.FixYoutubeEmbeds;
15 | if (!settings?.enabled) return;
16 |
17 | frame.executeJavaScript(`
18 | new MutationObserver(() => {
19 | if(
20 | document.querySelector('div.ytp-error-content-wrap-subreason a[href*="www.youtube.com/watch?v="]')
21 | ) location.reload()
22 | }).observe(document.body, { childList: true, subtree:true });
23 | `);
24 | }
25 | });
26 | });
27 | });
28 |
--------------------------------------------------------------------------------
/src/plugins/unlockedAvatarZoom/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2024 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { definePluginSettings } from "@api/Settings";
8 | import { Devs } from "@utils/constants";
9 | import definePlugin, { makeRange, OptionType } from "@utils/types";
10 |
11 | const settings = definePluginSettings({
12 | zoomMultiplier: {
13 | type: OptionType.SLIDER,
14 | description: "Zoom multiplier",
15 | markers: makeRange(2, 16),
16 | default: 4,
17 | },
18 | });
19 |
20 | export default definePlugin({
21 | name: "UnlockedAvatarZoom",
22 | description: "Allows you to zoom in further in the image crop tool when changing your avatar",
23 | authors: [Devs.nakoyasha],
24 | settings,
25 | patches: [
26 | {
27 | find: "#{intl::AVATAR_UPLOAD_EDIT_MEDIA}",
28 | replacement: {
29 | match: /maxValue:\d/,
30 | replace: "maxValue:$self.settings.store.zoomMultiplier",
31 | }
32 | }
33 | ]
34 | });
35 |
--------------------------------------------------------------------------------
/browser/monacoWin.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Vencord QuickCSS Editor
6 |
20 |
21 |
22 |
23 |
24 |
25 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/components/settings/QuickAction.css:
--------------------------------------------------------------------------------
1 | .vc-settings-quickActions-card {
2 | display: grid;
3 | grid-template-columns: repeat(3, 1fr);
4 | gap: 0.5em;
5 | padding: 0.5em;
6 | margin-bottom: 1em;
7 | }
8 |
9 | @media (width <=1040px) {
10 | .vc-settings-quickActions-card {
11 | grid-template-columns: repeat(2, 1fr);
12 | }
13 | }
14 |
15 | .vc-settings-quickActions-pill {
16 | all: unset;
17 | background: var(--button-secondary-background);
18 | color: var(--header-secondary);
19 | display: flex;
20 | align-items: center;
21 | gap: 0.5em;
22 | padding: 8px 9px;
23 | border-radius: 8px;
24 | transition: 0.1s ease-out;
25 | box-sizing: border-box;
26 | }
27 |
28 | .vc-settings-quickActions-pill:hover {
29 | background: var(--button-secondary-background-hover);
30 | transform: translateY(-1px);
31 | box-shadow: var(--elevation-high);
32 | }
33 |
34 | .vc-settings-quickActions-pill:focus-visible {
35 | outline: 2px solid var(--focus-primary);
36 | outline-offset: 2px;
37 | }
38 |
39 | .vc-settings-quickActions-img {
40 | width: 24px;
41 | height: 24px;
42 | }
--------------------------------------------------------------------------------
/packages/discord-types/src/stores/ChannelStore.d.ts:
--------------------------------------------------------------------------------
1 | import { Channel, FluxStore } from "..";
2 |
3 | export class ChannelStore extends FluxStore {
4 | getChannel(channelId: string): Channel;
5 | getBasicChannel(channelId: string): Channel | undefined;
6 | hasChannel(channelId: string): boolean;
7 |
8 | getChannelIds(guildId?: string | null): string[];
9 | getMutableBasicGuildChannelsForGuild(guildId: string): Record;
10 | getMutableGuildChannelsForGuild(guildId: string): Record;
11 | getAllThreadsForGuild(guildId: string): Channel[];
12 | getAllThreadsForParent(channelId: string): Channel[];
13 |
14 | getDMFromUserId(userId: string): string;
15 | getDMChannelFromUserId(userId: string): Channel | undefined;
16 | getDMUserIds(): string[];
17 | getMutableDMsByUserIds(): Record;
18 | getMutablePrivateChannels(): Record;
19 | getSortedPrivateChannels(): Channel[];
20 |
21 | getGuildChannelsVersion(guildId: string): number;
22 | getPrivateChannelsVersion(): number;
23 | getInitialOverlayState(): Record;
24 | }
25 |
--------------------------------------------------------------------------------
/src/utils/cspViolations.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2025 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { useLayoutEffect } from "@webpack/common";
8 |
9 | import { useForceUpdater } from "./react";
10 |
11 | const cssRelevantDirectives = ["style-src", "style-src-elem", "img-src", "font-src"] as const;
12 |
13 | export const CspBlockedUrls = new Set();
14 | const CspErrorListeners = new Set<() => void>();
15 |
16 | document.addEventListener("securitypolicyviolation", ({ effectiveDirective, blockedURI }) => {
17 | if (!blockedURI || !cssRelevantDirectives.includes(effectiveDirective as any)) return;
18 |
19 | CspBlockedUrls.add(blockedURI);
20 |
21 | CspErrorListeners.forEach(listener => listener());
22 | });
23 |
24 | export function useCspErrors() {
25 | const forceUpdate = useForceUpdater();
26 |
27 | useLayoutEffect(() => {
28 | CspErrorListeners.add(forceUpdate);
29 |
30 | return () => void CspErrorListeners.delete(forceUpdate);
31 | }, [forceUpdate]);
32 |
33 | return [...CspBlockedUrls] as const;
34 | }
35 |
--------------------------------------------------------------------------------
/browser/modifyResponseHeaders.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "id": 1,
4 | "action": {
5 | "type": "modifyHeaders",
6 | "responseHeaders": [
7 | {
8 | "header": "content-security-policy",
9 | "operation": "remove"
10 | },
11 | {
12 | "header": "content-security-policy-report-only",
13 | "operation": "remove"
14 | }
15 | ]
16 | },
17 | "condition": {
18 | "resourceTypes": ["main_frame", "sub_frame"]
19 | }
20 | },
21 | {
22 | "id": 2,
23 | "action": {
24 | "type": "modifyHeaders",
25 | "responseHeaders": [
26 | {
27 | "header": "content-type",
28 | "operation": "set",
29 | "value": "text/css"
30 | }
31 | ]
32 | },
33 | "condition": {
34 | "resourceTypes": ["stylesheet"],
35 | "urlFilter": "https://raw.githubusercontent.com/*"
36 | }
37 | }
38 | ]
39 |
--------------------------------------------------------------------------------
/src/components/Heading.css:
--------------------------------------------------------------------------------
1 | .vc-h1,
2 | .vc-h2 {
3 | color: var(--header-primary);
4 | font-weight: 600;
5 | }
6 |
7 | .vc-h3,
8 | .vc-h4,
9 | .vc-h5 {
10 | color: var(--header-secondary);
11 | }
12 |
13 | .vc-h1 {
14 | font-size: 20px;
15 | line-height: 24px
16 | }
17 |
18 | .vc-h2 {
19 | font-size: 16px;
20 | line-height: 20px
21 | }
22 |
23 | .vc-h3 {
24 | font-weight: 500;
25 | line-height: 24px
26 | }
27 |
28 | .vc-h3,
29 | .vc-h4 {
30 | font-size: 16px
31 | }
32 |
33 | .vc-h4 {
34 | font-weight: 600;
35 | letter-spacing: .3px
36 | }
37 |
38 | .vc-h4,
39 | .vc-h5 {
40 | line-height: 20px
41 | }
42 |
43 | .vc-h5 {
44 | color: var(--header-primary);
45 | font-size: 16px;
46 | font-weight: 500;
47 | margin-bottom: 8px;
48 | text-transform: unset
49 | }
50 |
51 | .vc-h1-defaultMargin,
52 | .vc-h2-defaultMargin {
53 | margin-bottom: 20px
54 | }
55 |
56 | /* This is copied from Discord, don't ask me why 0 margin */
57 | .vc-h4-defaultMargin {
58 | margin-bottom: 0;
59 | margin-top: 0;
60 | }
61 |
62 | .vc-h3-defaultMargin,
63 | .vc-h5-defaultMargin {
64 | margin-bottom: 8px
65 | }
--------------------------------------------------------------------------------
/src/utils/lazyReact.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2023 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import type { ComponentType } from "react";
8 |
9 | import { makeLazy } from "./lazy";
10 |
11 | const NoopComponent = () => null;
12 |
13 | export type LazyComponentWrapper = ComponentType & { $$vencordGetWrappedComponent(): ComponentType; };
14 |
15 | /**
16 | * A lazy component. The factory method is called on first render.
17 | * @param factory Function returning a Component
18 | * @param attempts How many times to try to get the component before giving up
19 | * @returns Result of factory function
20 | */
21 | export function LazyComponent(factory: () => ComponentType, attempts = 5): LazyComponentWrapper> {
22 | const get = makeLazy(factory, attempts);
23 | const LazyComponent = (props: T) => {
24 | const Component = get() ?? NoopComponent;
25 | return ;
26 | };
27 |
28 | LazyComponent.$$vencordGetWrappedComponent = get;
29 |
30 | return LazyComponent;
31 | }
32 |
--------------------------------------------------------------------------------
/src/components/settings/PluginBadge.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | export function AddonBadge({ text, color }) {
20 | return (
21 |
26 | {text}
27 |
28 | );
29 | }
30 |
--------------------------------------------------------------------------------
/src/utils/onlyOnce.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2023 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | export function onlyOnce(f: F): F {
20 | let called = false;
21 | let result: any;
22 | return function onlyOnceWrapper(this: unknown) {
23 | if (called) return result;
24 |
25 | called = true;
26 |
27 | return (result = f.apply(this, arguments));
28 | } as unknown as F;
29 | }
30 |
--------------------------------------------------------------------------------
/src/components/settings/tabs/plugins/components/ComponentSetting.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | import { PluginOptionComponent } from "@utils/types";
20 |
21 | import { ComponentSettingProps } from "./Common";
22 |
23 | export function ComponentSetting({ option, onChange }: ComponentSettingProps) {
24 | return option.component({ setValue: onChange, option });
25 | }
26 |
--------------------------------------------------------------------------------
/src/plugins/notificationVolume/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2023 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { definePluginSettings } from "@api/Settings";
8 | import { Devs } from "@utils/constants";
9 | import definePlugin, { OptionType } from "@utils/types";
10 |
11 | const settings = definePluginSettings({
12 | notificationVolume: {
13 | type: OptionType.SLIDER,
14 | description: "Notification volume",
15 | markers: [0, 25, 50, 75, 100],
16 | default: 100,
17 | stickToMarkers: false
18 | }
19 | });
20 |
21 | export default definePlugin({
22 | name: "NotificationVolume",
23 | description: "Save your ears and set a separate volume for notifications and in-app sounds",
24 | authors: [Devs.philipbry],
25 | settings,
26 | patches: [
27 | {
28 | find: "ensureAudio(){",
29 | replacement: {
30 | match: /(?=Math\.min\(\i\.\i\.getOutputVolume\(\)\/100)/g,
31 | replace: "$self.settings.store.notificationVolume/100*"
32 | },
33 | },
34 | ],
35 | });
36 |
--------------------------------------------------------------------------------
/src/plugins/themeAttributes/README.md:
--------------------------------------------------------------------------------
1 | # ThemeAttributes
2 |
3 | This plugin adds data attributes and CSS variables to various elements inside Discord
4 |
5 | This allows themes to more easily theme those elements or even do things that otherwise wouldn't be possible
6 |
7 | ## Available Attributes
8 |
9 | ### All Tab Bars (User Settings, Server Settings, etc)
10 |
11 | `data-tab-id` contains the id of that tab
12 |
13 | 
14 |
15 | ### Chat Messages
16 |
17 | - `data-author-id` contains the id of the author
18 | - `data-author-username` contains the username of the author
19 | - `data-is-self` is a boolean indicating whether this is the current user's message
20 |
21 | 
22 |
23 | ## CSS Variables
24 |
25 | ### Avatars
26 |
27 | `--avatar-url-` contains a URL for the users avatar with the size attribute adjusted for the resolutions `128, 256, 512, 1024, 2048, 4096`.
28 |
29 | 
30 |
--------------------------------------------------------------------------------
/src/components/handleComponentFailed.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | import { maybePromptToUpdate } from "@utils/updater";
20 |
21 | export function handleComponentFailed() {
22 | maybePromptToUpdate(
23 | "Uh Oh! Failed to render this Page." +
24 | " However, there is an update available that might fix it." +
25 | " Would you like to update and restart now?"
26 | );
27 | }
28 |
--------------------------------------------------------------------------------
/src/components/settings/QuickAction.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2024 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import "./QuickAction.css";
8 |
9 | import { classNameFactory } from "@api/Styles";
10 | import { Card } from "@components/Card";
11 | import type { ComponentType, PropsWithChildren, ReactNode } from "react";
12 |
13 | const cl = classNameFactory("vc-settings-quickActions-");
14 |
15 | export interface QuickActionProps {
16 | Icon: ComponentType<{ className?: string; }>;
17 | text: ReactNode;
18 | action?: () => void;
19 | disabled?: boolean;
20 | }
21 |
22 | export function QuickAction(props: QuickActionProps) {
23 | const { Icon, action, text, disabled } = props;
24 |
25 | return (
26 |
30 | );
31 | }
32 |
33 | export function QuickActionCard(props: PropsWithChildren) {
34 | return (
35 |
36 | {props.children}
37 |
38 | );
39 | }
40 |
--------------------------------------------------------------------------------
/src/plugins/messageLogger/messageLogger.css:
--------------------------------------------------------------------------------
1 | .messagelogger-deleted [class^="buttons"] {
2 | display: none;
3 | }
4 |
5 | .messagelogger-deleted
6 | :is(
7 | .messagelogger-deleted-attachment,
8 | .emoji,
9 | [data-type="sticker"],
10 | [class*="embedIframe"],
11 | [class*="embedSpotify"],
12 | [class*="imageContainer"]
13 | ) {
14 | filter: grayscale(1) !important;
15 | transition: 150ms filter ease-in-out;
16 |
17 | &[class*="hiddenMosaicItem_"] {
18 | filter: grayscale(1) blur(var(--custom-message-attachment-spoiler-blur-radius, 44px)) !important;
19 | }
20 |
21 | &:hover {
22 | filter: grayscale(0) !important;
23 | }
24 | }
25 |
26 | .messagelogger-deleted [class*="spoilerWarning"] {
27 | color: var(--status-danger);
28 | }
29 |
30 | .theme-dark .messagelogger-edited {
31 | filter: brightness(80%);
32 | }
33 |
34 | .theme-light .messagelogger-edited {
35 | opacity: 0.5;
36 | }
37 |
38 | .messagelogger-edit-marker {
39 | cursor: pointer;
40 | }
41 |
42 | .vc-ml-modal-timestamp {
43 | cursor: unset;
44 | height: unset;
45 | }
46 |
47 | .vc-ml-modal-tab-bar {
48 | flex-wrap: wrap;
49 | gap: 16px;
50 | }
51 |
--------------------------------------------------------------------------------
/src/components/settings/tabs/plugins/ContributorModal.css:
--------------------------------------------------------------------------------
1 | .vc-author-modal-root {
2 | padding: 1em;
3 | }
4 |
5 | .vc-author-modal-header {
6 | display: flex;
7 | align-items: center;
8 | margin-bottom: 1em;
9 | }
10 |
11 | .vc-author-modal-name {
12 | text-transform: none;
13 | flex-grow: 0;
14 | background: var(--background-base-lowest);
15 | border-radius: 0 9999px 9999px 0;
16 | padding: 6px 0.8em 6px 0.5em;
17 | font-size: 20px;
18 | height: 20px;
19 | position: relative;
20 | text-wrap: nowrap;
21 | }
22 |
23 | .vc-author-modal-name::before {
24 | content: "";
25 | display: block;
26 | position: absolute;
27 | height: 100%;
28 | width: 32px;
29 | background: var(--background-base-lowest);
30 | z-index: -1;
31 | left: -32px;
32 | top: 0;
33 | border-top-left-radius: 9999px;
34 | border-bottom-left-radius: 9999px;
35 | }
36 |
37 | .vc-author-modal-avatar {
38 | height: 32px;
39 | width: 32px;
40 | border-radius: 50%;
41 | }
42 |
43 | .vc-author-modal-links {
44 | margin-left: auto;
45 | }
46 |
47 | .vc-author-modal-plugins {
48 | display: grid;
49 | gap: 0.5em;
50 | margin-top: 0.75em;
51 | }
--------------------------------------------------------------------------------
/src/plugins/biggerStreamPreview/webpack/stores.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2023 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | import { findStoreLazy } from "@webpack";
20 |
21 | import * as t from "./types/stores";
22 |
23 | export const ApplicationStreamPreviewStore: t.ApplicationStreamPreviewStore = findStoreLazy("ApplicationStreamPreviewStore");
24 | export const ApplicationStreamingStore: t.ApplicationStreamingStore = findStoreLazy("ApplicationStreamingStore");
25 |
--------------------------------------------------------------------------------
/src/plugins/betterSessions/types.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2023 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | export interface SessionInfo {
20 | session: {
21 | id_hash: string;
22 | approx_last_used_time: Date;
23 | client_info: {
24 | os: string;
25 | platform: string;
26 | location: string;
27 | };
28 | },
29 | current?: boolean;
30 | }
31 |
32 | export type Session = SessionInfo["session"];
33 |
--------------------------------------------------------------------------------
/packages/discord-types/src/common/Activity.d.ts:
--------------------------------------------------------------------------------
1 | import { ActivityFlags, ActivityStatusDisplayType, ActivityType } from "../../enums";
2 |
3 | export interface ActivityAssets {
4 | large_image?: string;
5 | large_text?: string;
6 | large_url?: string;
7 | small_image?: string;
8 | small_text?: string;
9 | small_url?: string;
10 | }
11 |
12 | export interface ActivityButton {
13 | label: string;
14 | url: string;
15 | }
16 |
17 | export interface Activity {
18 | name: string;
19 | application_id: string;
20 | type: ActivityType;
21 | state?: string;
22 | state_url?: string;
23 | details?: string;
24 | details_url?: string;
25 | url?: string;
26 | flags: ActivityFlags;
27 | status_display_type?: ActivityStatusDisplayType;
28 | timestamps?: {
29 | start?: number;
30 | end?: number;
31 | };
32 | assets?: ActivityAssets;
33 | buttons?: string[];
34 | metadata?: {
35 | button_urls?: Array;
36 | };
37 | party?: {
38 | id?: string;
39 | size?: [number, number];
40 | };
41 | }
42 |
43 | export type OnlineStatus = "online" | "idle" | "dnd" | "invisible" | "offline" | "unknown" | "streaming";
44 |
--------------------------------------------------------------------------------
/src/utils/dependencies.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | // The below code is only used on the Desktop (electron) build of Vencord.
20 | // Browser (extension) builds do not contain these remote imports.
21 |
22 | export const shikiWorkerSrc = `https://cdn.jsdelivr.net/npm/@vap/shiki-worker@0.0.8/dist/${IS_DEV ? "index.js" : "index.min.js"}`;
23 | export const shikiOnigasmSrc = "https://cdn.jsdelivr.net/npm/@vap/shiki@0.10.3/dist/onig.wasm";
24 |
--------------------------------------------------------------------------------
/src/components/ErrorCard.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | import "./ErrorCard.css";
20 |
21 | import { classes } from "@utils/misc";
22 | import type { HTMLProps } from "react";
23 |
24 | export function ErrorCard(props: React.PropsWithChildren>) {
25 | return (
26 |
27 | {props.children}
28 |
29 | );
30 | }
31 |
--------------------------------------------------------------------------------
/src/plugins/webScreenShareFixes.web/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2024 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { Devs } from "@utils/constants";
8 | import definePlugin from "@utils/types";
9 |
10 | export default definePlugin({
11 | name: "WebScreenShareFixes",
12 | authors: [Devs.Kaitlyn],
13 | description: "Removes 2500kbps bitrate cap on chromium and vesktop clients.",
14 | enabledByDefault: true,
15 | patches: [
16 | {
17 | find: "x-google-max-bitrate",
18 | replacement: [
19 | {
20 | match: /"x-google-max-bitrate=".concat\(\i\)/,
21 | replace: '"x-google-max-bitrate=".concat("80_000")'
22 | },
23 | {
24 | match: ";level-asymmetry-allowed=1",
25 | replace: ";b=AS:800000;level-asymmetry-allowed=1"
26 | },
27 | {
28 | match: /;usedtx=".concat\((\i)\?"0":"1"\)/,
29 | replace: '$&.concat($1?";stereo=1;sprop-stereo=1":"")'
30 | }
31 | ]
32 | }
33 | ]
34 | });
35 |
--------------------------------------------------------------------------------
/src/webpack/types.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2025 Vendicated, Nuckyz and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { Module, ModuleExports, WebpackRequire } from "@vencord/discord-types/webpack";
8 |
9 | import { SYM_ORIGINAL_FACTORY, SYM_PATCHED_BY, SYM_PATCHED_SOURCE } from "./patchWebpack";
10 |
11 | export type AnyWebpackRequire = ((moduleId: PropertyKey) => ModuleExports) & Partial> & {
12 | /** The module factories, where all modules that have been loaded are stored (pre-loaded or loaded by lazy chunks) */
13 | m: Record;
14 | };
15 |
16 | /** exports can be anything, however initially it is always an empty object */
17 | export type AnyModuleFactory = ((this: ModuleExports, module: Module, exports: ModuleExports, require: AnyWebpackRequire) => void) & {
18 | [SYM_PATCHED_SOURCE]?: string;
19 | [SYM_PATCHED_BY]?: Set;
20 | };
21 |
22 | export type PatchedModuleFactory = AnyModuleFactory & {
23 | [SYM_ORIGINAL_FACTORY]: AnyModuleFactory;
24 | [SYM_PATCHED_SOURCE]?: string;
25 | [SYM_PATCHED_BY]?: Set;
26 | };
27 |
28 | export type MaybePatchedModuleFactory = PatchedModuleFactory | AnyModuleFactory;
29 |
--------------------------------------------------------------------------------
/src/plugins/clientTheme/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2023 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import "./clientTheme.css";
8 |
9 | import { definePluginSettings } from "@api/Settings";
10 | import { Devs } from "@utils/constants";
11 | import definePlugin, { OptionType, StartAt } from "@utils/types";
12 |
13 | import { ResetThemeColorComponent, ThemeSettingsComponent } from "./components/Settings";
14 | import { disableClientTheme, startClientTheme } from "./utils/styleUtils";
15 |
16 | export const settings = definePluginSettings({
17 | color: {
18 | type: OptionType.COMPONENT,
19 | default: "313338",
20 | component: ThemeSettingsComponent
21 | },
22 | resetColor: {
23 | type: OptionType.COMPONENT,
24 | component: ResetThemeColorComponent
25 | }
26 | });
27 |
28 | export default definePlugin({
29 | name: "ClientTheme",
30 | authors: [Devs.Nuckyz],
31 | description: "Recreation of the old client theme experiment. Add a color to your Discord client theme",
32 | settings,
33 |
34 | startAt: StartAt.DOMContentLoaded,
35 | start: () => startClientTheme(settings.store.color),
36 | stop: disableClientTheme
37 | });
38 |
--------------------------------------------------------------------------------
/scripts/utils.mjs:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2023 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | /**
20 | * @param {string} filePath
21 | * @returns {string | null}
22 | */
23 | export function getPluginTarget(filePath) {
24 | const pathParts = filePath.split(/[/\\]/);
25 | if (/^index\.tsx?$/.test(pathParts.at(-1))) pathParts.pop();
26 |
27 | const identifier = pathParts.at(-1).replace(/\.tsx?$/, "");
28 | const identiferBits = identifier.split(".");
29 | return identiferBits.length === 1 ? null : identiferBits.at(-1);
30 | }
31 |
--------------------------------------------------------------------------------
/src/plugins/shikiCodeblocks.desktop/utils/color.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | export function hex2Rgb(hex: string) {
20 | hex = hex.slice(1);
21 | if (hex.length < 6)
22 | hex = hex
23 | .split("")
24 | .map(c => c + c)
25 | .join("");
26 | if (hex.length === 6) hex += "ff";
27 | if (hex.length > 6) hex = hex.slice(0, 6);
28 | return hex
29 | .split(/(..)/)
30 | .filter(Boolean)
31 | .map(c => parseInt(c, 16));
32 | }
33 |
--------------------------------------------------------------------------------
/browser/monaco.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2023 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import "./patch-worker";
8 |
9 | import * as monaco from "monaco-editor/esm/vs/editor/editor.main.js";
10 |
11 | declare global {
12 | const baseUrl: string;
13 | const getCurrentCss: () => Promise;
14 | const setCss: (css: string) => void;
15 | const getTheme: () => string;
16 | }
17 |
18 | const BASE = "/vendor/monaco/vs";
19 |
20 | self.MonacoEnvironment = {
21 | getWorkerUrl(_moduleId: unknown, label: string) {
22 | const path = label === "css" ? "/language/css/css.worker.js" : "/editor/editor.worker.js";
23 | return new URL(BASE + path, baseUrl).toString();
24 | }
25 | };
26 |
27 | getCurrentCss().then(css => {
28 | const editor = monaco.editor.create(
29 | document.getElementById("container")!,
30 | {
31 | value: css,
32 | language: "css",
33 | theme: getTheme(),
34 | }
35 | );
36 | editor.onDidChangeModelContent(() =>
37 | setCss(editor.getValue())
38 | );
39 | window.addEventListener("resize", () => {
40 | // make monaco re-layout
41 | editor.layout();
42 | });
43 | });
44 |
--------------------------------------------------------------------------------
/src/components/settings/tabs/themes/styles.css:
--------------------------------------------------------------------------------
1 | .vc-settings-theme-grid {
2 | display: grid;
3 | gap: 16px;
4 | grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
5 | }
6 |
7 | .vc-settings-theme-card {
8 | display: flex;
9 | flex-direction: column;
10 | background-color: var(--background-base-lower-alt);
11 | color: var(--interactive-active);
12 | border-radius: 8px;
13 | padding: 1em;
14 | width: 100%;
15 | transition: 0.1s ease-out;
16 | transition-property: box-shadow, transform, background, opacity;
17 | }
18 |
19 | .vc-settings-theme-card-text {
20 | text-overflow: ellipsis;
21 | height: 1.2em;
22 | margin-bottom: 2px;
23 | white-space: nowrap;
24 | overflow: hidden;
25 | }
26 |
27 | .vc-settings-theme-author::before {
28 | content: "by ";
29 | }
30 |
31 | .vc-settings-csp-list {
32 | display: flex;
33 | flex-direction: column;
34 | gap: 8px;
35 | }
36 |
37 | .vc-settings-csp-row {
38 | display: flex;
39 | justify-content: space-between;
40 | align-items: center;
41 | gap: 8px;
42 |
43 |
44 | & a {
45 | text-overflow: ellipsis;
46 | overflow: hidden;
47 | white-space: nowrap;
48 | line-height: 1.2em;
49 | }
50 |
51 | --custom-button-button-md-height: 26px;
52 | }
--------------------------------------------------------------------------------
/src/plugins/decor/ui/components/DecorDecorationGridDecoration.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2023 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { Decoration } from "@plugins/decor/lib/api";
8 | import { decorationToAvatarDecoration } from "@plugins/decor/lib/utils/decoration";
9 | import { ContextMenuApi } from "@webpack/common";
10 | import type { HTMLProps } from "react";
11 |
12 | import { DecorationGridDecoration } from ".";
13 | import DecorationContextMenu from "./DecorationContextMenu";
14 |
15 | interface DecorDecorationGridDecorationProps extends HTMLProps {
16 | decoration: Decoration;
17 | isSelected: boolean;
18 | onSelect: () => void;
19 | }
20 |
21 | export default function DecorDecorationGridDecoration(props: DecorDecorationGridDecorationProps) {
22 | const { decoration } = props;
23 |
24 | return {
27 | ContextMenuApi.openContextMenu(e, () => (
28 |
31 | ));
32 | }}
33 | avatarDecoration={decorationToAvatarDecoration(decoration)}
34 | />;
35 | }
36 |
--------------------------------------------------------------------------------
/src/plugins/serverInfo/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2023 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
8 | import { Devs } from "@utils/constants";
9 | import definePlugin from "@utils/types";
10 | import { Guild } from "@vencord/discord-types";
11 | import { Menu } from "@webpack/common";
12 |
13 | import { openGuildInfoModal } from "./GuildInfoModal";
14 |
15 | const Patch: NavContextMenuPatchCallback = (children, { guild }: { guild: Guild; }) => {
16 | const group = findGroupChildrenByChildId("privacy", children);
17 |
18 | group?.push(
19 | openGuildInfoModal(guild)}
23 | />
24 | );
25 | };
26 |
27 | export default definePlugin({
28 | name: "ServerInfo",
29 | description: "Allows you to view info about a server",
30 | authors: [Devs.Ven, Devs.Nuckyz],
31 | dependencies: ["DynamicImageModalAPI"],
32 | tags: ["guild", "info", "ServerProfile"],
33 |
34 | contextMenus: {
35 | "guild-context": Patch,
36 | "guild-header-popout": Patch
37 | }
38 | });
39 |
--------------------------------------------------------------------------------
/src/plugins/voiceMessages/styles.css:
--------------------------------------------------------------------------------
1 | .vc-vmsg-modal {
2 | padding: 1em;
3 | }
4 |
5 | .vc-vmsg-buttons {
6 | display: grid;
7 | grid-template-columns: repeat(3, minmax(0, 1fr));
8 | gap: 0.5em;
9 | margin-bottom: 1em;
10 | }
11 |
12 | .vc-vmsg-preview {
13 | color: var(--text-default);
14 | border-radius: 24px;
15 | background-color: var(--background-base-lower);
16 | position: relative;
17 | display: flex;
18 | align-items: center;
19 | padding: 0 16px;
20 | height: 48px;
21 | }
22 |
23 | .vc-vmsg-preview-indicator {
24 | background: var(--button-secondary-background);
25 | width: 16px;
26 | height: 16px;
27 | border-radius: 50%;
28 | transition: background 0.2s ease-in-out;
29 | }
30 |
31 | .vc-vmsg-preview-recording .vc-vmsg-preview-indicator {
32 | background: var(--status-danger);
33 | }
34 |
35 | .vc-vmsg-preview-time {
36 | opacity: 0.8;
37 | margin: 0 0.5em;
38 | font-size: 80%;
39 |
40 | /* monospace so different digits have same size */
41 | font-family: var(--font-code);
42 | }
43 |
44 | .vc-vmsg-preview-label {
45 | opacity: 0.5;
46 | letter-spacing: 0.125em;
47 | font-weight: 600;
48 | flex: 1;
49 | text-align: center;
50 | }
51 |
52 | .vc-vmsg-error {
53 | color: var(--text-danger);
54 | }
--------------------------------------------------------------------------------
/packages/discord-types/src/stores/GuildMemberStore.d.ts:
--------------------------------------------------------------------------------
1 | import { FluxStore, GuildMember } from "..";
2 |
3 | export class GuildMemberStore extends FluxStore {
4 | /** @returns Format: [guildId-userId: Timestamp (string)] */
5 | getCommunicationDisabledUserMap(): Record;
6 | getCommunicationDisabledVersion(): number;
7 |
8 | getMutableAllGuildsAndMembers(): Record>;
9 |
10 | getMember(guildId: string, userId: string): GuildMember | null;
11 | getTrueMember(guildId: string, userId: string): GuildMember | null;
12 | getMemberIds(guildId: string): string[];
13 | getMembers(guildId: string): GuildMember[];
14 |
15 | getCachedSelfMember(guildId: string): GuildMember | null;
16 | getSelfMember(guildId: string): GuildMember | null;
17 | getSelfMemberJoinedAt(guildId: string): Date | null;
18 |
19 | getNick(guildId: string, userId: string): string | null;
20 | getNicknameGuildsMapping(userId: string): Record;
21 | getNicknames(userId: string): string[];
22 |
23 | isMember(guildId: string, userId: string): boolean;
24 | isMember(guildId: string, userId: string): boolean;
25 | isGuestOrLurker(guildId: string, userId: string): boolean;
26 | isCurrentUserGuest(guildId: string): boolean;
27 | }
28 |
--------------------------------------------------------------------------------
/src/plugins/decor/ui/components/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2023 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { AvatarDecoration } from "@plugins/decor";
8 | import { findComponentByCode, LazyComponentWebpack } from "@webpack";
9 | import { React } from "@webpack/common";
10 | import type { ComponentType, HTMLProps, PropsWithChildren } from "react";
11 |
12 | type DecorationGridItemComponent = ComponentType> & {
13 | onSelect: () => void,
14 | isSelected: boolean,
15 | }>;
16 |
17 | export let DecorationGridItem: DecorationGridItemComponent;
18 | export const setDecorationGridItem = v => DecorationGridItem = v;
19 |
20 | export const AvatarDecorationModalPreview = LazyComponentWebpack(() => {
21 | const component = findComponentByCode(".shopPreviewBanner");
22 | return React.memo(component);
23 | });
24 |
25 | type DecorationGridDecorationComponent = React.ComponentType & {
26 | avatarDecoration: AvatarDecoration;
27 | onSelect: () => void,
28 | isSelected: boolean,
29 | }>;
30 |
31 | export let DecorationGridDecoration: DecorationGridDecorationComponent;
32 | export const setDecorationGridDecoration = v => DecorationGridDecoration = v;
33 |
--------------------------------------------------------------------------------
/src/plugins/memberCount/style.css:
--------------------------------------------------------------------------------
1 | .vc-membercount-widget {
2 | gap: 0.85em;
3 | display: flex;
4 | align-content: center;
5 |
6 | --color-online: var(--green-360);
7 | --color-total: var(--primary-400);
8 | --color-voice: var(--primary-400);
9 | }
10 |
11 | .vc-membercount-tooltip {
12 | margin-top: 0.25em;
13 | margin-left: 2px;
14 | }
15 |
16 | .vc-membercount-member-list {
17 | justify-content: center;
18 | flex-wrap: wrap;
19 | margin-top: 1em;
20 | padding-inline: 1em;
21 | line-height: 1.2em;
22 | }
23 |
24 | .vc-membercount-container {
25 | display: flex;
26 | align-items: center;
27 | gap: 0.5em;
28 | }
29 |
30 | .vc-membercount-online {
31 | color: var(--color-online);
32 | }
33 |
34 | .vc-membercount-total {
35 | color: var(--color-total);
36 | }
37 |
38 | .vc-membercount-voice {
39 | color: var(--color-voice);
40 | }
41 |
42 | .vc-membercount-online-count {
43 | fill: var(--status-online);
44 | width: 18px;
45 | height: 18px;
46 | }
47 |
48 | .vc-membercount-total-count {
49 | fill: none;
50 | stroke: var(--status-offline);
51 | stroke-width: 4px;
52 | width: 15px;
53 | height: 15px;
54 | }
55 |
56 | .vc-membercount-voice-icon {
57 | color: var(--color-voice);
58 | width: 15px;
59 | height: 15px;
60 | }
--------------------------------------------------------------------------------
/src/plugins/voiceMessages/settings.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2023 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | import { definePluginSettings } from "@api/Settings";
20 | import { OptionType } from "@utils/types";
21 |
22 | export const settings = definePluginSettings({
23 | noiseSuppression: {
24 | type: OptionType.BOOLEAN,
25 | description: "Noise Suppression",
26 | default: true,
27 | },
28 | echoCancellation: {
29 | type: OptionType.BOOLEAN,
30 | description: "Echo Cancellation",
31 | default: true,
32 | },
33 | });
34 |
--------------------------------------------------------------------------------
/packages/discord-types/src/common/messages/Emoji.d.ts:
--------------------------------------------------------------------------------
1 | export type Emoji = CustomEmoji | UnicodeEmoji;
2 |
3 | export interface CustomEmoji {
4 | type: 1;
5 | allNamesString: string;
6 | animated: boolean;
7 | available: boolean;
8 | guildId: string;
9 | id: string;
10 | managed: boolean;
11 | name: string;
12 | originalName?: string;
13 | require_colons: boolean;
14 | roles: string[];
15 | }
16 |
17 | export interface UnicodeEmoji {
18 | type: 0;
19 | diversityChildren: Record;
20 | emojiObject: {
21 | names: string[];
22 | surrogates: string;
23 | unicodeVersion: number;
24 | };
25 | index: number;
26 | surrogates: string;
27 | uniqueName: string;
28 | useSpriteSheet: boolean;
29 | get allNamesString(): string;
30 | get animated(): boolean;
31 | get defaultDiversityChild(): any;
32 | get hasDiversity(): boolean | undefined;
33 | get hasDiversityParent(): boolean | undefined;
34 | get hasMultiDiversity(): boolean | undefined;
35 | get hasMultiDiversityParent(): boolean | undefined;
36 | get managed(): boolean;
37 | get name(): string;
38 | get names(): string[];
39 | get optionallyDiverseSequence(): string | undefined;
40 | get unicodeVersion(): number;
41 | get url(): string;
42 | }
43 |
--------------------------------------------------------------------------------
/src/plugins/noF1/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | import { Devs } from "@utils/constants";
20 | import definePlugin from "@utils/types";
21 |
22 | export default definePlugin({
23 | name: "NoF1",
24 | description: "Disables F1 help bind.",
25 | authors: [Devs.Cyn],
26 | patches: [
27 | {
28 | find: ',"f1"],comboKeysBindGlobal:',
29 | replacement: {
30 | match: ',"f1"],comboKeysBindGlobal:',
31 | replace: "],comboKeysBindGlobal:",
32 | },
33 | },
34 | ],
35 | });
36 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // this allows you to debug Vencord from VSCode.
3 | // How to use:
4 | // You need to run Discord via the command line to pass some flags to it.
5 | // If you want to debug the main (node.js) process (preload.ts, ipcMain/*, patcher.ts),
6 | // add the --inspect flag
7 | // To debug the renderer (99% of Vencord), add the --remote-debugging-port=9223 flag
8 | //
9 | // Now launch the desired configuration in VSCode and start Discord with the flags.
10 | // For example, to debug both process, run Electron: All then launch Discord with
11 | // discord --remote-debugging-port=9223 --inspect
12 |
13 | "version": "0.2.0",
14 | "configurations": [
15 | {
16 | "name": "Electron: Main",
17 | "type": "node",
18 | "request": "attach",
19 | "port": 9229,
20 | "timeout": 30000
21 | },
22 | {
23 | "name": "Electron: Renderer",
24 | "type": "chrome",
25 | "request": "attach",
26 | "port": 9223,
27 | "timeout": 30000,
28 | "webRoot": "${workspaceFolder}/src"
29 | }
30 | ],
31 | "compounds": [
32 | {
33 | "name": "Electron: All",
34 | "configurations": ["Electron: Main", "Electron: Renderer"]
35 | }
36 | ]
37 | }
38 |
--------------------------------------------------------------------------------
/src/api/MessageUpdater.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2024 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { Message } from "@vencord/discord-types";
8 | import { MessageCache, MessageStore } from "@webpack/common";
9 |
10 | /**
11 | * Update and re-render a message
12 | * @param channelId The channel id of the message
13 | * @param messageId The message id
14 | * @param fields The fields of the message to change. Leave empty if you just want to re-render
15 | */
16 | export function updateMessage(channelId: string, messageId: string, fields?: Partial>) {
17 | const channelMessageCache = MessageCache.getOrCreate(channelId);
18 | if (!channelMessageCache.has(messageId)) return;
19 |
20 | // To cause a message to re-render, we basically need to create a new instance of the message and obtain a new reference
21 | // If we have fields to modify we can use the merge method of the class, otherwise we just create a new instance with the old fields
22 | const newChannelMessageCache = channelMessageCache.update(messageId, (oldMessage: any) => {
23 | return fields ? oldMessage.merge(fields) : new oldMessage.constructor(oldMessage);
24 | });
25 |
26 | MessageCache.commit(newChannelMessageCache);
27 | MessageStore.emitChange();
28 | }
29 |
--------------------------------------------------------------------------------
/src/plugins/noOnboardingDelay/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | import { Devs } from "@utils/constants";
20 | import definePlugin from "@utils/types";
21 |
22 | export default definePlugin({
23 | name: "NoOnboardingDelay",
24 | description: "Skips the slow and annoying onboarding delay",
25 | authors: [Devs.nekohaxx],
26 | patches: [
27 | {
28 | find: "#{intl::ONBOARDING_COVER_WELCOME_SUBTITLE}",
29 | replacement: {
30 | match: "3e3",
31 | replace: "0"
32 | },
33 | },
34 | ],
35 | });
36 |
--------------------------------------------------------------------------------
/src/plugins/dontRoundMyTimestamps/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2023 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | import { Devs } from "@utils/constants";
20 | import definePlugin from "@utils/types";
21 | import { moment } from "@webpack/common";
22 |
23 | export default definePlugin({
24 | name: "DontRoundMyTimestamps",
25 | authors: [Devs.Lexi],
26 | description: "Always rounds relative timestamps down, so 7.6y becomes 7y instead of 8y",
27 |
28 | start() {
29 | moment.relativeTimeRounding(Math.floor);
30 | },
31 |
32 | stop() {
33 | moment.relativeTimeRounding(Math.round);
34 | }
35 | });
36 |
--------------------------------------------------------------------------------
/src/plugins/secretRingTone/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a Discord client mod
3 | * Copyright (c) 2023 Vendicated and contributors
4 | * SPDX-License-Identifier: GPL-3.0-or-later
5 | */
6 |
7 | import { definePluginSettings } from "@api/Settings";
8 | import { Devs } from "@utils/constants";
9 | import definePlugin, { OptionType } from "@utils/types";
10 |
11 | const settings = definePluginSettings({
12 | onlySnow: {
13 | type: OptionType.BOOLEAN,
14 | description: "Only play the Snow Halation Theme",
15 | default: false,
16 | restartNeeded: true
17 | }
18 | });
19 |
20 | export default definePlugin({
21 | name: "SecretRingToneEnabler",
22 | description: "Always play the secret version of the discord ringtone (except during special ringtone events)",
23 | authors: [Devs.AndrewDLO, Devs.FieryFlames, Devs.RamziAH],
24 | settings,
25 | patches: [
26 | {
27 | find: '"call_ringing_beat"',
28 | replacement: [
29 | {
30 | match: /500!==\i\(\)\.random\(1,1e3\)/,
31 | replace: "false"
32 | },
33 | {
34 | predicate: () => settings.store.onlySnow,
35 | match: /"call_ringing_beat",/,
36 | replace: ""
37 | }
38 | ]
39 | }
40 | ]
41 | });
42 |
--------------------------------------------------------------------------------
/src/plugins/shikiCodeblocks.desktop/hooks/useCopyCooldown.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | import { copyToClipboard } from "@utils/clipboard";
20 | import { React } from "@webpack/common";
21 |
22 | export function useCopyCooldown(cooldown: number) {
23 | const [copyCooldown, setCopyCooldown] = React.useState(false);
24 |
25 | function copy(text: string) {
26 | copyToClipboard(text);
27 | setCopyCooldown(true);
28 |
29 | setTimeout(() => {
30 | setCopyCooldown(false);
31 | }, cooldown);
32 | }
33 |
34 | return [copyCooldown, copy] as const;
35 | }
36 |
--------------------------------------------------------------------------------
/browser/background.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @template T
3 | * @param {T[]} arr
4 | * @param {(v: T) => boolean} predicate
5 | */
6 | function removeFirst(arr, predicate) {
7 | const idx = arr.findIndex(predicate);
8 | if (idx !== -1) arr.splice(idx, 1);
9 | }
10 |
11 | chrome.webRequest.onHeadersReceived.addListener(
12 | ({ responseHeaders, type, url }) => {
13 | if (!responseHeaders) return;
14 |
15 | if (type === "main_frame") {
16 | // In main frame requests, the CSP needs to be removed to enable fetching of custom css
17 | // as desired by the user
18 | removeFirst(responseHeaders, h => h.name.toLowerCase() === "content-security-policy");
19 | } else if (type === "stylesheet" && url.startsWith("https://raw.githubusercontent.com/")) {
20 | // Most users will load css from GitHub, but GitHub doesn't set the correct content type,
21 | // so we fix it here
22 | removeFirst(responseHeaders, h => h.name.toLowerCase() === "content-type");
23 | responseHeaders.push({
24 | name: "Content-Type",
25 | value: "text/css"
26 | });
27 | }
28 | return { responseHeaders };
29 | },
30 | { urls: ["https://raw.githubusercontent.com/*", "*://*.discord.com/*"], types: ["main_frame", "stylesheet"] },
31 | ["blocking", "responseHeaders"]
32 | );
33 |
--------------------------------------------------------------------------------
/src/components/Switch.css:
--------------------------------------------------------------------------------
1 | .vc-switch-container {
2 | background: var(--primary-400);
3 | border: 1px solid transparent;
4 | border-radius: 16px;
5 | box-sizing: border-box;
6 | cursor: pointer;
7 | height: 28px;
8 | position: relative;
9 | width: 44px;
10 |
11 | .high-contrast-mode & {
12 | border-color: var(--border-strong);
13 | }
14 | }
15 |
16 | .vc-switch-checked {
17 | background: var(--brand-500);
18 | border-color: var(--control-border-primary-default);
19 | }
20 |
21 | .vc-switch-disabled {
22 | cursor: not-allowed;
23 | opacity: 0.3;
24 | }
25 |
26 | .vc-switch-focusVisible {
27 | /* stylelint-disable-next-line custom-property-pattern */
28 | box-shadow: 0 0 0 4px var(--__adaptive-focus-ring-color, var(--focus-primary, #00b0f4));
29 | }
30 |
31 | .vc-switch-slider {
32 | display: block;
33 | height: 20px;
34 | left: 0;
35 | margin: 3px;
36 | position: absolute;
37 | width: 28px;
38 | transition: 100ms transform ease-in-out;
39 | overflow: visible;
40 | }
41 |
42 | .vc-switch-input {
43 | border-radius: 14px;
44 | cursor: pointer;
45 | height: 100%;
46 | left: 0;
47 | margin: 0;
48 | opacity: 0;
49 | position: absolute;
50 | top: 0;
51 | width: 100%;
52 |
53 | &:disabled {
54 | pointer-events: none;
55 | cursor: not-allowed
56 | }
57 | }
--------------------------------------------------------------------------------
/src/shared/debounce.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | /**
20 | * Returns a new function that will call the wrapped function
21 | * after the specified delay. If the function is called again
22 | * within the delay, the timer will be reset.
23 | * @param func The function to wrap
24 | * @param delay The delay in milliseconds
25 | */
26 | export function debounce(func: T, delay = 300): T {
27 | let timeout: NodeJS.Timeout;
28 | return function (...args: any[]) {
29 | clearTimeout(timeout);
30 | timeout = setTimeout(() => { func(...args); }, delay);
31 | } as any;
32 | }
33 |
--------------------------------------------------------------------------------
/packages/discord-types/src/stores/DraftStore.d.ts:
--------------------------------------------------------------------------------
1 | import { FluxStore } from "..";
2 |
3 | export enum DraftType {
4 | ChannelMessage = 0,
5 | ThreadSettings = 1,
6 | FirstThreadMessage = 2,
7 | ApplicationLauncherCommand = 3,
8 | Poll = 4,
9 | SlashCommand = 5,
10 | ForwardContextMessage = 6
11 | }
12 |
13 | export interface Draft {
14 | timestamp: number;
15 | draft: string;
16 | }
17 |
18 | export interface ThreadSettingsDraft {
19 | timestamp: number;
20 | parentMessageId?: string;
21 | name?: string;
22 | isPrivate?: boolean;
23 | parentChannelId?: string;
24 | location?: string;
25 | }
26 |
27 | export type ChannelDrafts = {
28 | [DraftType.ThreadSettings]: ThreadSettingsDraft;
29 | } & {
30 | [key in Exclude]: Draft;
31 | };
32 |
33 | export type UserDrafts = Partial>;
34 | export type DraftState = Partial>;
35 |
36 | export class DraftStore extends FluxStore {
37 | getState(): DraftState;
38 | getRecentlyEditedDrafts(type: DraftType): Array;
39 | getDraft(channelId: string, type: DraftType): string;
40 |
41 | getThreadSettings(channelId: string): ThreadSettingsDraft | null | undefined;
42 | getThreadDraftWithParentMessageId(parentMessageId: string): ThreadSettingsDraft | null | undefined;
43 | }
44 |
--------------------------------------------------------------------------------
/src/plugins/shikiCodeblocks.desktop/utils/createStyle.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | const styles = new Map();
20 |
21 | export function setStyle(css: string, id: string) {
22 | const style = document.createElement("style");
23 | style.innerText = css;
24 | document.head.appendChild(style);
25 | styles.set(id, style);
26 | }
27 |
28 | export function removeStyle(id: string) {
29 | styles.get(id)?.remove();
30 | return styles.delete(id);
31 | }
32 |
33 | export const clearStyles = () => {
34 | styles.forEach(style => style.remove());
35 | styles.clear();
36 | };
37 |
--------------------------------------------------------------------------------
/browser/userscript.meta.js:
--------------------------------------------------------------------------------
1 | // ==UserScript==
2 | // @name Vencord
3 | // @description A Discord client mod - Web version
4 | // @version %version%
5 | // @author Vendicated (https://github.com/Vendicated)
6 | // @namespace https://github.com/Vendicated/Vencord
7 | // @supportURL https://github.com/Vendicated/Vencord
8 | // @icon https://raw.githubusercontent.com/Vendicated/Vencord/refs/heads/main/browser/icon.png
9 | // @license GPL-3.0
10 | // @match *://*.discord.com/*
11 | // @grant GM_xmlhttpRequest
12 | // @grant unsafeWindow
13 | // @run-at document-start
14 | // @compatible chrome Chrome + Tampermonkey or Violentmonkey
15 | // @compatible firefox Firefox Tampermonkey
16 | // @compatible opera Opera + Tampermonkey or Violentmonkey
17 | // @compatible edge Edge + Tampermonkey or Violentmonkey
18 | // @compatible safari Safari + Tampermonkey or Violentmonkey
19 | // ==/UserScript==
20 |
21 |
22 | // this UserScript DOES NOT work on Firefox with Violentmonkey or Greasemonkey due to a bug that makes it impossible
23 | // to overwrite stuff on the window on sites that use CSP. Use Tampermonkey or use a chromium based browser
24 | // https://github.com/violentmonkey/violentmonkey/issues/997
25 |
26 | // this is a compiled and minified version of Vencord. For the source code, visit the GitHub repo
27 |
--------------------------------------------------------------------------------
/browser/manifestv2.json:
--------------------------------------------------------------------------------
1 | {
2 | "manifest_version": 2,
3 | "minimum_chrome_version": "91",
4 |
5 | "name": "Vencord Web",
6 | "description": "The cutest Discord mod now in your browser",
7 | "author": "Vendicated",
8 | "homepage_url": "https://github.com/Vendicated/Vencord",
9 | "icons": {
10 | "128": "icon.png"
11 | },
12 |
13 | "permissions": [
14 | "webRequest",
15 | "webRequestBlocking",
16 | "*://*.discord.com/*",
17 | "https://raw.githubusercontent.com/*"
18 | ],
19 |
20 | "content_scripts": [
21 | {
22 | "run_at": "document_start",
23 | "matches": ["*://*.discord.com/*"],
24 | "js": ["content.js"],
25 | "all_frames": true,
26 | "world": "ISOLATED"
27 | },
28 | {
29 | "run_at": "document_start",
30 | "matches": ["*://*.discord.com/*"],
31 | "js": ["dist/Vencord.js"],
32 | "all_frames": true,
33 | "world": "MAIN"
34 | }
35 | ],
36 |
37 | "background": {
38 | "scripts": ["background.js"]
39 | },
40 |
41 | "web_accessible_resources": ["dist/Vencord.js", "dist/Vencord.css"],
42 |
43 | "browser_specific_settings": {
44 | "gecko": {
45 | "id": "vencord-firefox@vendicated.dev",
46 | "strict_min_version": "128.0"
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/plugins/iLoveSpam/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | import { Devs } from "@utils/constants";
20 | import definePlugin from "@utils/types";
21 |
22 | export default definePlugin({
23 | name: "iLoveSpam",
24 | description: "Do not hide messages from 'likely spammers'",
25 | authors: [Devs.botato, Devs.Nyako],
26 | patches: [
27 | {
28 | find: "hasFlag:{writable",
29 | replacement: {
30 | match: /if\((\i)<=(?:0x40000000|(?:1<<30|1073741824))\)return/,
31 | replace: "if($1===(1<<20))return false;$&",
32 | },
33 | },
34 | ],
35 | });
36 |
--------------------------------------------------------------------------------
/src/plugins/loadingQuotes/quotes.txt:
--------------------------------------------------------------------------------
1 | # Blank lines and lines starting with "#" are ignored
2 |
3 | Explode
4 | Read if cute
5 | Have a nice day!
6 | Starting Lightcord...
7 | Loading 0BDFDB.plugin.js...
8 | Installing BetterDiscord...
9 | h
10 | shhhhh did you know that you're my favourite user? But don't tell the others!!
11 | Today's video is sponsored by Raid Shadow Legends, one of the biggest mobile role-playing games of 2019 and it's totally free!
12 | Never gonna give you up, Never gonna let you down
13 | ( ͡° ͜ʖ ͡°)
14 | (ノ◕ヮ◕)ノ*:・゚✧
15 | You look so pretty today!
16 | Thinking of a funny quote...
17 | 3.141592653589793
18 | meow
19 | Welcome, friend
20 | If you, or someone you love, has Ligma, please see the Ligma health line at https://bit.ly/ligma_hotline
21 | Trans Rights
22 | I’d just like to interject for a moment. What you’re refering to as Linux, is in fact, GNU/Linux, or as I’ve recently taken to calling it, GNU plus Linux.
23 | You're doing good today!
24 | Don't worry, it's nothing 9 cups of coffee couldn't solve!
25 | �(repeat like 30 times)
26 | a light amount of tomfoolery is okay
27 | do you love?
28 | horror
29 | so eepy
30 | So without further ado, let's just jump right into it!
31 | Dying is absolutely safe
32 | hey you! you're cute :))
33 | heya ~
34 | <:trolley:997086295010594867>
35 | Time is gone, space is insane. Here it comes, here again.
36 | sometimes it's okay to just guhhhhhhhhhhhhhh
37 | Welcome to nginx!
38 |
--------------------------------------------------------------------------------
/src/plugins/noUnblockToJump/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Sofia Lima
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | import { Devs } from "@utils/constants";
20 | import definePlugin from "@utils/types";
21 |
22 | export default definePlugin({
23 | name: "NoUnblockToJump",
24 | description: "Allows you to jump to messages of blocked or ignored users and likely spammers without unblocking them",
25 | authors: [Devs.dzshn],
26 | patches: [
27 | {
28 | find: "#{intl::UNIGNORE_TO_JUMP_BODY}",
29 | replacement: {
30 | match: /return \i\.\i\.isBlockedForMessage\(/,
31 | replace: "return true;$&"
32 | }
33 | }
34 | ]
35 | });
36 |
--------------------------------------------------------------------------------
/src/plugins/_api/messageAccessories.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | import { Devs } from "@utils/constants";
20 | import definePlugin from "@utils/types";
21 |
22 | export default definePlugin({
23 | name: "MessageAccessoriesAPI",
24 | description: "API to add message accessories.",
25 | authors: [Devs.Cyn],
26 | patches: [
27 | {
28 | find: "#{intl::REMOVE_ATTACHMENT_BODY}",
29 | replacement: {
30 | match: /(?<=.container\)?,children:)(\[.+?\])/,
31 | replace: "Vencord.Api.MessageAccessories._modifyAccessories($1,this.props)",
32 | },
33 | },
34 | ],
35 | });
36 |
--------------------------------------------------------------------------------
/src/plugins/noDevtoolsWarning/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Vencord, a modification for Discord's desktop app
3 | * Copyright (c) 2022 Vendicated and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | import { Devs } from "@utils/constants";
20 | import definePlugin from "@utils/types";
21 |
22 | export default definePlugin({
23 | name: "NoDevtoolsWarning",
24 | description: "Disables the 'HOLD UP' banner in the console. As a side effect, also prevents Discord from hiding your token, which prevents random logouts.",
25 | authors: [Devs.Ven],
26 | patches: [{
27 | find: "setDevtoolsCallbacks",
28 | replacement: {
29 | match: /if\(null!=\i&&"0.0.0"===\i\.remoteApp\.getVersion\(\)\)/,
30 | replace: "if(true)"
31 | }
32 | }]
33 | });
34 |
--------------------------------------------------------------------------------