diff options
author | megumin <megumin.bakaretsurie@gmail.com> | 2022-10-02 17:59:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-02 18:59:37 +0200 |
commit | 46585efc029fd9e99deeef7f9d0f0b6446480a35 (patch) | |
tree | 86023dad91ae7ec8b2f0fca4544cc896c54d778f /src | |
parent | e4c41d5d6cb4ae758be4d02fa6edcbe469dcdb26 (diff) | |
download | Vencord-46585efc029fd9e99deeef7f9d0f0b6446480a35.tar.gz Vencord-46585efc029fd9e99deeef7f9d0f0b6446480a35.tar.bz2 Vencord-46585efc029fd9e99deeef7f9d0f0b6446480a35.zip |
feat(plugins): Add isStaff plugin (#25)
* feat(plugins): Add isStaff plugin
* fix(plugins/isStaff): Improve patches
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/isStaff.ts | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/plugins/isStaff.ts b/src/plugins/isStaff.ts new file mode 100644 index 0000000..aacfc4d --- /dev/null +++ b/src/plugins/isStaff.ts @@ -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 ", + }, + ], + }, + ], +}); |