Commit c2bf9883 by softwhiskey8

добавил отдельную функцию получения текущего времени и пару правок в dsl

1 parent 45c7d4fc
Showing with 8 additions and 4 deletions
......@@ -23,6 +23,7 @@ context {
output promocode: string = "PROMO-CODE";
output mail_start: number = 0;
output mail_end: number = 0;
output conv_start2: number = 0;
}
external function numbers_from_text(text: string): string;
......@@ -42,6 +43,7 @@ external function check_mobile_code(phone: string): boolean;
external function countWords(message: string): number;
external function sendTelegram(phone: string, json: unknown): string;
external function sendTelegramChannel(phone: string, channel_type: string, mail: string): string;
external function get_time(): number;
start node root
{
......@@ -82,6 +84,7 @@ node caller_id
// Запоминаем временной штамп перед самой первой репликой
set $conversation_begin = external time_stamp();
set $conv_start2 = external get_time();
#say("greeting");
var result = blockcall SkipMessagesBlock();
wait *;
......@@ -210,7 +213,7 @@ node mail
{
negative: do
{
set $mail_start = external get_time();
}
positive: do
{
......@@ -236,7 +239,6 @@ node getMail
{
default: do
{
set $mail_start = external time_stamp();
set $mail = #getMessageText();
}
}
......@@ -497,9 +499,9 @@ node yes_whatsapp
//Отлично. Сейчас отправлю Вам промокод. Всего доброго до свидания.
$cjm.push("yes_whatsapp");
set $accepted_code = true;
set $mail_end = external get_time();
#say("gonna_send_code");
var result = blockcall SkipMessagesBlock();
set $mail_end = external time_stamp();
goto end_conversation;
}
transitions
......
......@@ -160,7 +160,9 @@ async function main() {
} else {
await dasha.chat.createConsoleChat(conv);
}
app.setExternal("get_time", async (args, conv) => {
return (Date.now() / 1000).toFixed();
});
// Устанавливаем минимальный уровень фонового шума
conv.audio.noiseVolume = 0.1;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!