Fix bug where nitro would not be applied if plugin was loaded before currentUser is available
This commit is contained in:
parent
223932bf28
commit
fc13e6c345
12
index.js
12
index.js
@ -16,7 +16,17 @@ module.exports = class NitroBypass extends Plugin {
|
|||||||
const currentUser = await getModule(['getCurrentUser']);
|
const currentUser = await getModule(['getCurrentUser']);
|
||||||
|
|
||||||
// spoof client side premium
|
// spoof client side premium
|
||||||
currentUser.getCurrentUser().premiumType = 2;
|
this.log("Checking for currentUser...");
|
||||||
|
var x = setInterval(() => {
|
||||||
|
var user = currentUser.getCurrentUser();
|
||||||
|
if(user != null) {
|
||||||
|
user.premiumType = 2;
|
||||||
|
this.log("Spoofed!");
|
||||||
|
clearInterval(x);
|
||||||
|
} else {
|
||||||
|
this.log("currentUser not found, retrying in 1s...");
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user