aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/isStaff.ts
diff options
context:
space:
mode:
authorBanTheNons <banthenons@gmail.com>2022-10-11 00:45:11 +0300
committerGitHub <noreply@github.com>2022-10-10 23:45:11 +0200
commite685e399f9a2eb41a936d38dcebbd4a2889dd507 (patch)
tree524a25995864a1497fd268999fde83693ba699ae /src/plugins/isStaff.ts
parent54198b1a4a57c50ca5902293abbd1ddea226bffa (diff)
downloadVencord-e685e399f9a2eb41a936d38dcebbd4a2889dd507.tar.gz
Vencord-e685e399f9a2eb41a936d38dcebbd4a2889dd507.tar.bz2
Vencord-e685e399f9a2eb41a936d38dcebbd4a2889dd507.zip
fix(plugin): fix isStaff returning true for all users (#83)
Co-authored-by: nmsturcke <30734036+nmsturcke@users.noreply.github.com>
Diffstat (limited to 'src/plugins/isStaff.ts')
-rw-r--r--src/plugins/isStaff.ts20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/plugins/isStaff.ts b/src/plugins/isStaff.ts
index aacfc4d..c5a95d0 100644
--- a/src/plugins/isStaff.ts
+++ b/src/plugins/isStaff.ts
@@ -5,18 +5,24 @@ export default definePlugin({
name: "isStaff",
description:
"Gives access to client devtools & other things locked behind isStaff",
- authors: [Devs.Megu],
+ authors: [
+ Devs.Megu,
+ {
+ name: "Nickyux",
+ id: 427146305651998721n
+ },
+ {
+ name: "BanTheNons",
+ id: 460478012794863637n
+ }
+ ],
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: /return\s*(\w+)\.hasFlag\((.+?)\.STAFF\)}/,
+ replace: "return Vencord.Webpack.Common.UserStore.getCurrentUser().id===$1.id||$1.hasFlag($2.STAFF)}"
},
{
match: /hasFreePremium=function\(\){return this.isStaff\(\)\s*\|\|/,