fix error on !list when bridge client is not connected

This commit is contained in:
Lamp 2018-07-25 12:06:48 -07:00 committed by GitHub
parent 4d99f27b61
commit 2277fba410
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -8,6 +8,11 @@ module.exports = {
message.reply(`Use this in a bridged room to see who is at the other side.`);
return;
}
var client = clients[row.site][row.mpp_room];
if (!client || !client.isConnected()) {
message.reply(`This bridge is not connected.`);
return;
}
var ppl = clients[row.site][row.mpp_room].ppl;
var numberOfPpl = Object.keys(ppl).length;
@ -20,4 +25,4 @@ module.exports = {
str += names.join(', ');
message.channel.send(str, {split:{char:''}});
}
};
};