Comments (8)
The reason the error is occurs even though the constant use_telegram is set to default is that the TeleBot object is being instantiated without check if it will be needed in trader.js
:
const telBot = new TeleBot({
token: telegramToken, // Required. Telegram Bot API token.
polling: { // Optional. Use polling.
...
And inside the telebot.js, the constructor has the following check:
if (!cfg.token || cfg.token.split(':').length !== 2) {
throw Error('[bot.error] invalid bot token');
}
The cfg.token default value fails because the default cfg_token value is not in the expected format.
Possible Solutions are:
- Dirty Solution
To add one single double point:
character in the default value of cfg.token intelebot.js
. - A Better Solution
To move config constant preferences such asuse_telegram
and other on the top oftrader.js
and for the telegram bot case, to add checks if the value is true. This way is not only cleaner but provides a better performance as it does not call constructors which will then not be used through the lifetime of the application.
I would personally go for the better solution. I will issue a pull request shortly.
from node-binance-trader.
I reverted the last commit from the PR that caused the issue for now. Please feel free to try again.
from node-binance-trader.
@Plasto13 could you please take a look at this issue?
from node-binance-trader.
Hello @jsappme I contacted @Plasto13 in the Discord Channel stated in the README.md file about this issue. I also forked the repository and will introduce a pull request to fix the issue shortly.
from node-binance-trader.
Perfect. Thank you. @insertmike
from node-binance-trader.
Hello @jsappme the content I added has been successfully added, thanks for approving the request. However some part of the merging has not been successful, for example missing dependencies because of the revert of commit id 094e2f2f480fe180a33ed1e4117da2156dcc45e6
. I am fixing it shortly and will create another pull request. Sorry!
from node-binance-trader.
from node-binance-trader.
Great! Now it is all up and running. I am closing this issue as its solution is commited in pull request #41 and #42.
from node-binance-trader.
Related Issues (20)
- Signals no longer received HOT 29
- heroku deploy build error HOT 2
- Pairs Unknown HOT 1
- feat: rewrite trader in typescript HOT 1
- Sponsor username invalid HOT 3
- Postgres connect error HOT 1
- Error: error: password authentication failed for, when run start HOT 4
- Support for usdt instead of btc HOT 1
- Get Cross Margin Market Pairs
- Cross Margin Market Data HOT 1
- fix: repay exceeds borrow amount on testing HOT 2
- Deploy Heroku HOT 9
- senin proje HOT 1
- MongoDB on Heroku HOT 2
- No margin pair available for some coins HOT 9
- INSTALL ON WINDOWS HOT 1
- The automated release is failing π¨
- Pairs in ENV HOT 3
- Socket documentation HOT 2
- PAIR UNKNOWN on every buy - USDT strategy support HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-binance-trader.