feat(plugins): Add isStaff plugin (#25)
* feat(plugins): Add isStaff plugin * fix(plugins/isStaff): Improve patches
This commit is contained in:
parent
e4c41d5d6c
commit
46585efc02
1 changed files with 28 additions and 0 deletions
28
src/plugins/isStaff.ts
Normal file
28
src/plugins/isStaff.ts
Normal file
|
@ -0,0 +1,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 ",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
Loading…
Reference in a new issue