Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Alexander
/
alex-hunter-sales-dev
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 835e7d0f
authored
Nov 01, 2022
by
softwhiskey8
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
добавил передачу json из dsl
1 parent
3846d45b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
app/main.dsl
index.js
app/main.dsl
View file @
835e7d0
...
@@ -20,6 +20,7 @@ context {
...
@@ -20,6 +20,7 @@ context {
output conversation_end: number = 0;
output conversation_end: number = 0;
output channel_type: string = "";
output channel_type: string = "";
output mail: string = "";
output mail: string = "";
json: string[] = [];
}
}
external function numbers_from_text(text: string): string;
external function numbers_from_text(text: string): string;
...
@@ -37,7 +38,7 @@ external function last_four(phone: string): string;
...
@@ -37,7 +38,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;
external function sendTelegram(
phone: string, json: unknown
): string;
external function sendTelegramChannel(channel_type: string, mail: string): string;
external function sendTelegramChannel(channel_type: string, mail: string): string;
start node root
start node root
...
@@ -140,13 +141,13 @@ node tg
...
@@ -140,13 +141,13 @@ node tg
set $channel_type = "Telegram";
set $channel_type = "Telegram";
external sendTelegramChannel($channel_type, ""); //отправка уведомления в канал
external sendTelegramChannel($channel_type, ""); //отправка уведомления в канал
var message = {
var message = {webinar: "Как продавать на маркетплейсах в 2022",
webinar: "Как продавать на маркетплейсах в 2022",
date: "11 июля",
date: "11 июля",
promocode: "PROMO-CODE"
promocode: "PROMO-CODE"
};
};
external sendTelegram(); //отправка личного сообщения
//set $json = ["Как продавать на маркетплейсах в 2022","11 июля", "PROMO-CODE"];
external sendTelegram($caller, message); //отправка личного сообщения
}
}
}
}
}
}
...
...
index.js
View file @
835e7d0
...
@@ -140,9 +140,11 @@ async function main() {
...
@@ -140,9 +140,11 @@ async function main() {
app
.
setExternal
(
"sendTelegram"
,
(
args
)
=>
{
app
.
setExternal
(
"sendTelegram"
,
(
args
)
=>
{
var
cmd
=
`cd /servers/constructor/htdocs/api/; php telegram-send.php `
;
var
cmd
=
`cd /servers/constructor/htdocs/api/; php telegram-send.php `
;
var
tmp_json
=
`{webinar:\"Как продавать на маркетплейсах в 2022\",date:\"11 июля\",promocode:\"SAMLOH\"}`
;
//var tmp_json = `{webinar:\"Как продавать на маркетплейсах в 2022\",date:\"11 июля\",promocode:\"SAMLOH\"}`;
var
tmp_json
=
args
[
'json'
];
var
phone_number
=
args
[
'phone'
];
tmp_json
=
JSON
.
stringify
(
tmp_json
);
tmp_json
=
JSON
.
stringify
(
tmp_json
);
cmd
+=
`
${
events_owner
}
${
preset_template_id
}
${
p
rocess
.
argv
[
2
]
}
empty empty empty
${
tmp_json
}
`
;
cmd
+=
`
${
events_owner
}
${
preset_template_id
}
${
p
hone_number
}
empty empty empty
${
tmp_json
}
`
;
exec
(
cmd
);
exec
(
cmd
);
});
});
//функция отправки сообщений в канал
//функция отправки сообщений в канал
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment