From 81ce0c440f609be5e951351cc7184b62df686b27 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Thu, 18 Nov 2021 22:28:12 +0300 Subject: save --- index.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'index.js') diff --git a/index.js b/index.js index e4ffb71..82e4281 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,7 @@ const Request = require('request-promise'); const dotenv = require('dotenv'); dotenv.config(); + const token = process.env['TELEGRAM_TOKEN']; const chat_id = process.env['TELEGRAM_CHAT_ID']; const api_key = process.env['BINANCE_API_KEY']; @@ -15,16 +16,13 @@ if (NODE_ENV === "development") { } else { console.log("NODE_ENV production") } + //Indian time string const event = new Date().toLocaleString('en-IN', { timeZone: timeZone, timeZoneName: 'short' }); -//only for heroku port error -const express = require('express'); -const app = express(); -app.all('/', (req, res) => res.send('Bot is Running')); -app.listen(port, () => console.log(`${event} - Server started on ${port} port`)); + //BinanceWS const binanceApi = require('binance'); const binanceWS = new binanceApi.BinanceWS(false); @@ -39,7 +37,7 @@ try { process_data(data); }, 60000).then(() => { console.log(`${event} - Monitoring Spot User Order Data for binance.com`); - sendMessage(`Binance Spot Order Monitor Started\nthis message shows that you or heroku(if your are using) restart the bot.`) + // sendMessage(`Binance Spot Order Monitor Started\nthis message shows that you or heroku(if your are using) restart the bot.`) }) } catch (err) { console.error(`${event} - ${err}`) @@ -103,7 +101,7 @@ function process_data(data) { } } else if (executionType === 'CANCELED') { if (orderStatus === 'CANCELED') { - txt = `❎ ❎ ❎\nSpot ${orderType} ${side} Order CANCELED\nSymbol: #${symbol}\nPrice: ${price}\nQuantity: ${fixFloat(quantity)}${total}\nOrder ID: #ID${orderId}` + txt = `❌ ❌ ❌\nSpot ${orderType} ${side} Order CANCELED\nSymbol: #${symbol}\nPrice: ${price}\nQuantity: ${fixFloat(quantity)}${total}\nOrder ID: #ID${orderId}` } } else if (executionType === 'TRADE') { if (orderStatus === 'PARTIALLY_FILLED') { -- cgit v1.2.3