This commit is contained in:
Lamp 2021-08-14 17:18:22 -07:00
parent 90431b0fad
commit 4a5d4b8dd6
2 changed files with 2 additions and 1 deletions

View File

@ -117,7 +117,7 @@ Client.prototype.connect = function() {
});
this.ws.addEventListener("open", function(evt) {
self.connectionTime = Date.now();
self.sendArray([{m: "hi", x: 1, token: self.uri.includes("mppclone.com") ? config.mpc_token : undefined}]);
self.sendArray([{m: "hi", x: 1, token: self.token}]);
self.pingInterval = setInterval(function() {
self.sendArray([{m: "t", e: Date.now()}]);
}, 20000);

View File

@ -45,6 +45,7 @@ global.createMPPbridge = function createMPPbridge(room, DiscordChannelID, site =
site == "YFLV" ? new Client("wss://mpp.yourfriend.lv/ws") :
undefined;
if (!gClient) return console.error(`Invalid site ${site}`);
if (site == "MPP") gClient.token = config.mpp_token;
gClient.setChannel(/*(site == "MPP" && room == "lobby") ? "lolwutsecretlobbybackdoor" : */room, {visible:false});
gClient.start();