Hide channel when solo

closes #5
This commit is contained in:
Lamp 2018-07-02 21:38:23 -07:00 committed by GitHub
parent 5ec1bff6e9
commit d9f1ab5e09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -191,6 +191,17 @@ global.createMPPbridge = function (room, DiscordChannelID, site = 'MPP', webhook
}
});
gClient.on("ch", function(msg){
if (gClient.isOwner()) {
if (gClient.countParticipants() <= 1) {
gClient.sendArray([{m:'chset', set: { visible: false }}])
} else {
gClient.sendArray([{m:'chset', set: { visible: true }}])
}
}
});
// addons
gClient.on('participant update', function(participant){