aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/isStaff.ts
blob: aacfc4d4826df45ac24faef90d8c01c5b3662e71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";

export default definePlugin({
    name: "isStaff",
    description:
        "Gives access to client devtools & other things locked behind isStaff",
    authors: [Devs.Megu],
    patches: [
        {
            find: ".isStaff=function(){",
            replacement: [
                {
                    match: /(\w+)\.isStaff=function\(\){return\s*!1};/,
                    replace: "$1.isStaff=function(){return true};",
                },
                {
                    match: /return\s*\w+\.hasFlag\(.+?STAFF\)}/,
                    replace: "return true}",
                },
                {
                    match: /hasFreePremium=function\(\){return this.isStaff\(\)\s*\|\|/,
                    replace: "hasFreePremium=function(){return ",
                },
            ],
        },
    ],
});