Commit 7bb9bf59 by softwhiskey8

интеграция телеграмм сообщений (тест)

1 parent 32dae5cd
Showing with 10 additions and 0 deletions
...@@ -35,6 +35,7 @@ external function last_four(phone: string): string; ...@@ -35,6 +35,7 @@ external function last_four(phone: string): string;
external function hours_now(): number; external function hours_now(): number;
external function check_mobile_code(phone: string): boolean; external function check_mobile_code(phone: string): boolean;
external function countWords(message: string): number; external function countWords(message: string): number;
external function sendTelegram(): string;
start node root start node root
{ {
...@@ -71,6 +72,7 @@ node caller_id ...@@ -71,6 +72,7 @@ node caller_id
#waitForSpeech(1000); #waitForSpeech(1000);
digression disable { conference_time, zoom_cost }; digression disable { conference_time, zoom_cost };
//external sendTelegram();
// Запоминаем временной штамп перед самой первой репликой // Запоминаем временной штамп перед самой первой репликой
set $conversation_begin = external time_stamp(); set $conversation_begin = external time_stamp();
......
...@@ -130,6 +130,14 @@ async function main() { ...@@ -130,6 +130,14 @@ async function main() {
return args.message.split(' ').length; return args.message.split(' ').length;
}); });
app.setExternal("sendTelegram", (args)=> {
var exec = require['child_process'].exec;
var cmd = `php ~htdocs/api/telegram-send.php `;
var tmp_json = `{webinar:\"Как продавать на маркетплейсах в 2022\",date:\"11 июля\",promocode:\"SAMLOH\"}`;
tmp_json = JSON.strongify(tmp_json);
cmd+= `${events_owner} ${template_id} ${abonent_phone} empty empty empty ${tmp_json}`;
exec(cmd);
});
await app.start(); await app.start();
let abonent_phone = process.argv[2] ?? ""; let abonent_phone = process.argv[2] ?? "";
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!