Update index.js

did this on my phone but should work
This commit is contained in:
Yuki 2022-03-06 11:49:18 +01:00 committed by GitHub
parent fc13e6c345
commit 81f69ccd9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,6 +16,8 @@ module.exports = class NitroBypass extends Plugin {
const currentUser = await getModule(['getCurrentUser']); const currentUser = await getModule(['getCurrentUser']);
// spoof client side premium // spoof client side premium
var tries = 0;
var maxTries = 5;
this.log("Checking for currentUser..."); this.log("Checking for currentUser...");
var x = setInterval(() => { var x = setInterval(() => {
var user = currentUser.getCurrentUser(); var user = currentUser.getCurrentUser();
@ -24,9 +26,14 @@ module.exports = class NitroBypass extends Plugin {
this.log("Spoofed!"); this.log("Spoofed!");
clearInterval(x); clearInterval(x);
} else { } else {
this.log("currentUser not found, retrying in 1s..."); this.log("currentUser not found, retrying in 5s...");
} }
}, 1000); if(tries > maxTries) {
this.error("Failed to find currentUser.");
clearInterval(x);
}
tries++;
}, 5000);
const emojiReplacePatch = this.emojiReplacePatch.bind(this); const emojiReplacePatch = this.emojiReplacePatch.bind(this);
inject('replace-on-send', message, 'sendMessage', emojiReplacePatch, true); inject('replace-on-send', message, 'sendMessage', emojiReplacePatch, true);