Commit 4f0a68d0 by softwhiskey8

фикс передачи json объекта в веб-хук

1 parent f1acea53
Showing with 4 additions and 6 deletions
......@@ -140,15 +140,13 @@ async function main() {
app.setExternal("sendTelegram", (args)=> {
var cmd = `cd /servers/constructor/htdocs/api/; php telegram-send.php `;
var tmp_json1 = `{webinar:\"Как продавать на маркетплейсах в 2022\",date:\"11 июля\",promocode:\"SAMLOH\"}`;
var tmp_json = args['json'];
var phone_number = args['phone'];
//tmp_json = JSON.stringify(tmp_json);
var find = '\"';
var re = new RegExp(find, 'g');
tmp_json = JSON.stringify(tmp_json).replace(re, "\\\"");
tmp_json = "\"" + tmp_json + "\"";
cmd+= `${events_owner} ${preset_template_id} ${phone_number} empty empty empty ${tmp_json}`;
console.log("tmpjson:"); console.log(tmp_json);
console.log("cmd:"); console.log(cmd);
var temp_cmd = `${events_owner} ${preset_template_id} ${process.argv[2]} empty empty empty ${tmp_json1}`;
console.log("oldcmd:"); console.log(temp_cmd);
exec(cmd);
});
//функция отправки сообщений в канал
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!