don't repeat errors… 🤔

This commit is contained in:
Lamp 2018-11-29 12:37:29 -08:00 committed by GitHub
parent e82269b6f6
commit 748f0232d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -54,10 +54,14 @@ global.createMPPbridge = function createMPPbridge(room, DiscordChannelID, site =
gClient.setChannel(room);
}, 1000);
let lastError;
gClient.on("error", error => {
console.error(`[${site}][${room}]`, error.message);
dSend(`**${error.message}**`);
error = error.toString();
if (lastError != error) {
dSend(`**${error.toString()}**`);
lastError = error;
}
});
var isConnected = false; // TODO use gClient.isConnected() ?
gClient.on('connect', () => {