Giter VIP home page Giter VIP logo

binance-bot's Introduction

binance-bot

A very simple binance telegram bot

Motivation

I created this telegram bot to keep me informed of the status of my orders on Binance.

Usage

This bot will send you a message for every order started, canceled & filled.

To see your balance, type /balance.

How do I get this ?

1 - Create a telegram bot

Go and have a chat with @BotFather. Tell him /newbot, and follow the instructions.

BotFather will give you a token to control the bot, something like 123456789:AbCdfGhIJKlmNoQQRsTUVwxyZ.

2 - Get this code & add the token

Use the following command to get the code for this bot :

git clone https://github.com/louismerlin/binance-bot

Then create a secrets file to keep all your tokens (this file will not be seen by git) :

cd binance-bot
echo {\"binanceKey\": \"\", \"binanceSecret\": \"\", \"bot\": \"YOUR_TELEGRAM_BOT_TOKEN\", \"you\": 0} > secrets.json

Don't forget to replace YOUR_TELEGRAM_BOT_TOKEN by... your telegram bot token.

3 - Get your telegram ID

Now it's time to run your bot for the first time !

First install the dependencies, with either npm install or yarn install depending on what you use.

When this is done you can go ahead and node index.js. Don't be alarmed when it throws out some errors in your face, it's nothing serious.

What you need to do now is go to telegram and have a chat with your bot, using his handle (@mybot, the one that finishes with 'bot'). BotFather should have given you a link to him, too.

When you initiate the conversation, it sends the /start command to the bot, which triggers some more errors in your terminal, but more importantly, gives you your telegram id (of the form 12345678).

Copy this telegram ID into the secrets.json file, in the "you" field.

4 - Get your binance API keys

You can now (finaly) head over to binance. First make sure I did not trick you into a phishing attempt, and then log in.

When you're in, you should see on the main dashboard a API Settings button. Click on that.

Enter a label for your new API key, for example telegram, and click on Create New Key.

This bot only requires Read Info.

Once you have your key & secret, put those values into the secrets.json file.

You're done !

Good job, now you can run your bot with node index.js. If you would like it to continuously run, get yourself a small server somewhere and run node index.js & in the directory (don't forget to copy your secrets & install the dependencies). If you want to stop it down the line use killall node (if you have no other node processes running, otherwise kill PID, with PID being the processe's pid).

binance-bot's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.