Fix: alert

This commit is contained in:
Dung Nguyen 2022-03-06 08:53:38 +07:00
parent c0568a1ec2
commit 44b67d9278

View File

@ -40,6 +40,7 @@ let dInWeb = null; // Ví tiền theo web
let currentColorCandle = -1; // Nến hiện tại let currentColorCandle = -1; // Nến hiện tại
let totalColorCandle = 0; let totalColorCandle = 0;
let interrupted = 0; // Lãi thực tế let interrupted = 0; // Lãi thực tế
let isShowWarningInterrupted = false;
/** /**
* Tất cả config đây * Tất cả config đây
@ -456,6 +457,7 @@ SELL: /sell:[number]`,
if (text === '/reset_interrupted') { if (text === '/reset_interrupted') {
interrupted = 0; interrupted = 0;
isShowWarningInterrupted = false;
TeleGlobal.sendMessage( TeleGlobal.sendMessage(
myTelegramID, myTelegramID,
`Reset cắt lãi thành công!`, `Reset cắt lãi thành công!`,
@ -540,13 +542,14 @@ function roleEnterOrder(sessionID, lastResult) {
const currentEnterOrder = currentEnterOrderFn(); const currentEnterOrder = currentEnterOrderFn();
if (interrupted > CONFIG.interrupted) { if (interrupted > CONFIG.interrupted && !isShowWarningInterrupted) {
TeleGlobal.sendMessage( TeleGlobal.sendMessage(
TELEGRAM_CHANNEL, TELEGRAM_CHANNEL,
`Số lãi trong ngày (${interrupted}) lớn hơn số lãi config(${CONFIG.interrupted}). Hệ thống sẽ dừng lại!`, `Số lãi trong ngày (${interrupted}) lớn hơn số lãi config(${CONFIG.interrupted}). Hệ thống sẽ dừng lại!`,
{ parse_mode: "HTML" } { parse_mode: "HTML" }
); );
CONFIG.enterOrderList = []; CONFIG.enterOrderList = [];
isShowWarningInterrupted = true;
return; return;
} }