mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-24 13:57:02 -04:00
forked!!
This commit is contained in:
parent
538b87062a
commit
ea7451bcdc
326 changed files with 24876 additions and 2280 deletions
53
src/equicordplugins/platformSpoofer/index.ts
Normal file
53
src/equicordplugins/platformSpoofer/index.ts
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* Vencord, a Discord client mod
|
||||
* Copyright (c) 2023 Vendicated and contributors
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
|
||||
const settings = definePluginSettings({
|
||||
platform: {
|
||||
type: OptionType.SELECT,
|
||||
description: "What platform to show up as on",
|
||||
restartNeeded: true,
|
||||
options: [
|
||||
{
|
||||
label: "Desktop",
|
||||
value: "desktop",
|
||||
default: true
|
||||
},
|
||||
{
|
||||
label: "Web",
|
||||
value: "web"
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
export default definePlugin({
|
||||
name: "PlatformSpoofer",
|
||||
description: "Spoof what platform or device you're on",
|
||||
authors: [Devs.Drag],
|
||||
settings: settings,
|
||||
patches: [
|
||||
{
|
||||
find: "_doIdentify(){",
|
||||
replacement: {
|
||||
match: /(\[IDENTIFY\].*let.{0,5}=\{.*properties:)(.*),presence/,
|
||||
replace: "$1{...$2,...$self.getPlatform()},presence"
|
||||
}
|
||||
}
|
||||
],
|
||||
getPlatform: () => {
|
||||
switch (settings.store.platform ?? "desktop") {
|
||||
case "desktop":
|
||||
return { browser: "Discord Client" };
|
||||
case "web":
|
||||
return { browser: "Chrome" };
|
||||
}
|
||||
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue