Skip to content

Commit

Permalink
Update bot.js
Browse files Browse the repository at this point in the history
commenting out some deprecated code
  • Loading branch information
unixguru2k committed Dec 22, 2020
1 parent e559e4e commit 7a4c48e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions basic_sample_bot/server/bot.js
Expand Up @@ -70,13 +70,14 @@ app.post('/machaao_hook', function (req, res) {
let version = messaging.version && messaging.version.replace("v", "");
console.log("client: v" + version);

if(!messaging.client || (version && eval(version) < 0.585)) {
const _upgradeClient = "Sorry, you are using an older or an invalid version of the client.\nPlease update from Play Store....\nDownload -> https://play.google.com/store/apps/details?id=com.machaao.ganglia.cricket.release"; //findAndReplace(config.error_responses.maintenance_mode, "{name}", _sName);
res.status(500).send({
message: _upgradeClient
});
return;
}
// deprecated code
// if(!messaging.client || (version && eval(version) < 0.585)) {
// const _upgradeClient = "Sorry, you are using an older or an invalid version of the client.\nPlease update from Play Store....\nDownload -> https://play.google.com/store/apps/details?id=com.machaao.ganglia.cricket.release"; //findAndReplace(config.error_responses.maintenance_mode, "{name}", _sName);
// res.status(500).send({
// message: _upgradeClient
// });
// return;
// }

var msg = messaging.message_data && messaging.message_data.text ? messaging.message_data.text : "";
let _isMetaData = false;
Expand Down

0 comments on commit 7a4c48e

Please sign in to comment.