Using AWS Lambda with a schedule, to get the updates from Binance leaderboard
-
Setup Telegram Bot:
- For
TELEGRAM_BOT_API_KEY
: Create a new Bot; Message (@BotFather) to create a new bot and get you bot. - For
TELEGRAM_CHAT_ID
:- Create a new chat group.
- Add (
@RawDataBot
) to your group and type: "/start" to get the chat id. Reference - OR, Send a message to (
@username_to_id_bot
) with invitation link.
- For
-
In serverless.yml, replace those two values with yours from above steps:
TELEGRAM_BOT_API_KEY
TELEGRAM_CHAT_ID
-
In serverless.yml, change schedule rate:
This project uses
serverless
framework โก. So, make sure you get that first and give the necessary permissions toserverless cli
. Follow this page for getting started.
- Deploy the stack:
$ serverless deploy โ Service deployed to binance-leaderboard-bot-dev
- After deployment is successful, you can check the deployed stack details using:
$ serverless info service: binance-leaderboard-bot stage: dev region: us-east-1 stack: binance-leaderboard-bot-dev functions: binanceBot: binance-leaderboard-bot-dev-binanceBot layers: pybinance: arn:aws:lambda:us-east-1:xxxxx:layer:pybinance:x
To remove the stack and all the services and resources:
$ serverless remove
โ Service binance-leaderboard-bot has been successfully removed