aboutsummaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'index.js')
-rw-r--r--index.js12
1 files changed, 5 insertions, 7 deletions
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(`<b>Binance Spot Order Monitor Started</b>\nthis message shows that you or heroku(if your are using) restart the bot.`)
+ // sendMessage(`<b>Binance Spot Order Monitor Started</b>\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 = `❎ ❎ ❎\n<b>Spot ${orderType} ${side} Order CANCELED</b>\n<b>Symbol:</b> #${symbol}\n<b>Price:</b> ${price}\n<b>Quantity:</b> ${fixFloat(quantity)}${total}\n<b>Order ID:</b> #ID${orderId}`
+ txt = `❌ ❌ ❌\n<b>Spot ${orderType} ${side} Order CANCELED</b>\n<b>Symbol:</b> #${symbol}\n<b>Price:</b> ${price}\n<b>Quantity:</b> ${fixFloat(quantity)}${total}\n<b>Order ID:</b> #ID${orderId}`
}
} else if (executionType === 'TRADE') {
if (orderStatus === 'PARTIALLY_FILLED') {