erlpack require

This commit is contained in:
Jiiks 2018-01-15 06:43:28 +02:00
parent 861d95bd06
commit c801b09e9c
2 changed files with 36 additions and 0 deletions

View File

@ -27603,6 +27603,7 @@ class SocketProxy extends Module {
bindings() {
this.socketCreated = this.socketCreated.bind(this);
window.test = this;
}
socketCreated() {
@ -27610,6 +27611,23 @@ class SocketProxy extends Module {
console.log(Global.getObject('wsHook'));
}
get erlpack() {
if (this._erlpack) return this._erlpack;
try {
this._erlpack = window.require('erlpack');
} catch (err) {
console.log(err);
try {
this._erlpack = window.require('discord_erlpack');
} catch (err) {
console.log(err);
}
}
return this._erlpack;
}
}
const _instance = new SocketProxy();

View File

@ -20,6 +20,7 @@ class SocketProxy extends Module {
bindings() {
this.socketCreated = this.socketCreated.bind(this);
window.test = this;
}
socketCreated() {
@ -27,6 +28,23 @@ class SocketProxy extends Module {
console.log(Global.getObject('wsHook'));
}
get erlpack() {
if (this._erlpack) return this._erlpack;
try {
this._erlpack = window.require('erlpack');
} catch (err) {
console.log(err);
try {
this._erlpack = window.require('discord_erlpack');
} catch (err) {
console.log(err);
}
}
return this._erlpack;
}
}
const _instance = new SocketProxy();