fix(plugin): fix isStaff returning true for all users (#83)
Co-authored-by: nmsturcke <30734036+nmsturcke@users.noreply.github.com>
This commit is contained in:
parent
54198b1a4a
commit
e685e399f9
|
@ -5,18 +5,24 @@ export default definePlugin({
|
||||||
name: "isStaff",
|
name: "isStaff",
|
||||||
description:
|
description:
|
||||||
"Gives access to client devtools & other things locked behind isStaff",
|
"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: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: ".isStaff=function(){",
|
find: ".isStaff=function(){",
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
match: /(\w+)\.isStaff=function\(\){return\s*!1};/,
|
match: /return\s*(\w+)\.hasFlag\((.+?)\.STAFF\)}/,
|
||||||
replace: "$1.isStaff=function(){return true};",
|
replace: "return Vencord.Webpack.Common.UserStore.getCurrentUser().id===$1.id||$1.hasFlag($2.STAFF)}"
|
||||||
},
|
|
||||||
{
|
|
||||||
match: /return\s*\w+\.hasFlag\(.+?STAFF\)}/,
|
|
||||||
replace: "return true}",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
match: /hasFreePremium=function\(\){return this.isStaff\(\)\s*\|\|/,
|
match: /hasFreePremium=function\(\){return this.isStaff\(\)\s*\|\|/,
|
||||||
|
|
Loading…
Reference in a new issue