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 ccfca291
authored
Nov 24, 2022
by
Nick N. Sukharev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Внешняя функция external time_stamp(); заменена на внутренную функцию #getCurrentTime();
1 parent
b5bd7d44
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
app/main.dsl
index.js
app/main.dsl
View file @
ccfca29
...
...
@@ -32,7 +32,6 @@ external function part_of_the_day(): string;
external function is_empty(check: unknown): boolean;
external function sleep_ms(duration: number): unknown;
external function json_encode(object: unknown): string;
external function time_stamp(): number;
external function math_floor(value: number, presision: number|empty = 0): number;
external function math_round(value: number, presision: number|empty = 0): number;
external function math_ceil(value: number, presision: number|empty = 0): number;
...
...
@@ -50,7 +49,7 @@ start node root
do
{
$cjm.push("root");
set $conversation_start =
external time_stamp
();
set $conversation_start =
#getCurrentTime
();
goto caller_id;
}
transitions
...
...
@@ -83,7 +82,7 @@ node caller_id
//external sendTelegram();
// Запоминаем временной штамп перед самой первой репликой
set $conversation_begin =
external time_stamp
();
set $conversation_begin =
#getCurrentTime
();
set $conv_start2 = external get_time();
#say("greeting");
var result = blockcall SkipMessagesBlock();
...
...
@@ -770,7 +769,7 @@ node do_before_exit
do
{
$cjm.push("do_before_exit");
set $conversation_stop =
external time_stamp
();
set $conversation_stop =
#getCurrentTime
();
exit;
}
transitions
...
...
@@ -854,3 +853,5 @@ digression record
}
}
index.js
View file @
ccfca29
...
...
@@ -100,11 +100,6 @@ async function main() {
app
.
setExternal
(
"json_encode"
,
async
(
args
,
conv
)
=>
{
return
JSON
.
stringify
(
args
.
object
,
undefined
,
2
);
});
app
.
setExternal
(
"time_stamp"
,
async
(
args
,
conv
)
=>
{
return
Date
.
now
();
});
app
.
setExternal
(
"math_floor"
,
async
(
args
,
conv
)
=>
{
return
Math
.
floor
(
args
.
value
,
args
.
presision
);
});
...
...
@@ -340,9 +335,9 @@ async function main() {
if
(
shared
.
empty
(
conv_start
))
conv_start
=
0
;
if
(
shared
.
empty
(
conv_begin
))
conv_begin
=
0
;
if
(
shared
.
empty
(
conv_stop
))
conv_stop
=
0
;
if
(
conv_start
==
0
)
conv_start
=
ts
;
if
(
conv_begin
==
0
)
conv_begin
=
conv_start
;
if
(
conv_stop
==
0
)
conv_stop
=
Date
.
now
()
;
if
(
conv_start
==
0
)
conv_start
=
ts
;
else
conv_start
+=
ts
;
if
(
conv_begin
==
0
)
conv_begin
=
conv_start
;
else
conv_begin
+=
ts
;
if
(
conv_stop
==
0
)
conv_stop
=
Date
.
now
();
else
conv_stop
+=
ts
;
let
output_data
=
JSON
.
stringify
(
result
.
output
,
undefined
,
2
);
...
...
@@ -404,3 +399,7 @@ async function main() {
}
main
().
catch
((
err
)
=>
{
console
.
error
(
err
)});
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