diff --git a/src/mppbridger/index.js b/src/mppbridger/index.js index f51c7b0..5bb6a8c 100755 --- a/src/mppbridger/index.js +++ b/src/mppbridger/index.js @@ -67,9 +67,11 @@ global.createMPPbridge = function createMPPbridge(room, DiscordChannelID, site = gClient.on('connect', () => { console.log(`Connected to room ${room} of ${site} server`); dSend(`**Connected**`); // TODO say what room it actually connected to ? - gClient.sendArray([{m: "userset", set: {name: config.mppname}}]) isConnected = true; }); + gClient.on('hi', ()=>{ + if (!testmode) gClient.sendArray([{m: "userset", set: {name: config.mppname}}]) + }); gClient.on('disconnect', () => { if (isConnected) { console.log(`Disconnected from room ${room} of ${site} server`);