Plugin

PlatformSpoofer

Spoof what platform or device you're on

index.ts
Download

Source

src/plugins/platformSpoofer/index.ts
1/*
2 * FiveCord — a Discord client mod
3 * Copyright (c) 2025 FiveCord
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
7import { definePluginSettings } from "@api/Settings";
8import { Devs } from "@utils/constants";
9import definePlugin, { OptionType } from "@utils/types";
10
11const settings = definePluginSettings({
12 platform: {
13 type: OptionType.SELECT,
14 description: "What platform to show up as on",
15 restartNeeded: true,
16 options: [
17 {
18 label: "Desktop",
19 value: "desktop",
20 default: true
21 },
22 {
23 label: "Web",
24 value: "web"
25 }
26 ]
27 }
28});
29
30export default definePlugin({
31 name: "PlatformSpoofer",
32 description: "Spoof what platform or device you're on",
33 authors: [Devs.FiveCord],
34 settings: settings,
35 patches: [
36 {
37 find: "_doIdentify(){",
38 replacement: {
39 match: /(\[IDENTIFY\].*let.{0,5}=\{.*properties:)(.*),presence/,
40 replace: "$1{...$2,...$self.getPlatform()},presence"
41 }
42 }
43 ],
44 getPlatform: () => {
45 switch (settings.store.platform ?? "desktop") {
46 case "desktop":
47 return { browser: "Discord Client" };
48 case "web":
49 return { browser: "Chrome" };
50 }
51
52 }
53});
54