Skip to content

A telegram bot which provides cryptocurrency price and market info

Notifications You must be signed in to change notification settings

miridius/whatcoin

Repository files navigation

WhatCoin

CI/CD codecov

WhatCoin is a Telegram Bot which gives price and market information about crypto currencies.

It runs on AWS Lambda using the serverless-telegram sister library.

Bot Usage

Notes:

  • Coins can be input as name, symbol, or a prefix thereof. Currencies must be a symbol
  • Commands and arguments are not case sensitive.
  • The user's locale is respected when it comes to number formatting.

Implemented Commands / TO DOs

  • /price - get current price info about a currency, with optional conversion. E.g. /price bitcoin eur
  • /convert - convert an amount of one currency into another, e.g. /convert 100 ark eth.
  • /regret - show how much money you missed out on cos you sold too early - e.g /regret 10000 BTC 41 USD
  • /top10 - get the top 10 currencies by market cap, with optional conversion (symbol). E.g. /top10 gbp
  • /top20 - get the top 20 currencies by market cap, with optional conversion (symbol). E.g. /top20 btc
  • /chart - generate a chart of price & volume for the last X days and send it as an image
  • /ohlc - generate an OHLC candlestick chart for the last X days and send it as an image
  • /markets - show a list of markets (exchanges) where a currency can be traded. E.g. /markets ark
  • /version - show bot version (on deploy: send notification/update bot name?)
  • /help - show commands & their arguments
  • /settings - bot settings (e.g. default vs currency)
  • Update bot about & description

Command Info (to send to BotFather):

price - <coin/symbol=bitcoin> <in=USD>
convert - <amount=1> <from=BTC> <to=USD>
chart - <coin=btc> <in=USD> <days=1>
ohlc - <coin=btc> <in=USD> <days=1>
top10 - <in=USD>
top20 - <in=USD>
regret - <amt> <coin> <soldFor> <in=USD>

Local development

  • Run the function as a local web server in watch mode with npm start
  • Run the function against a live development bot with npm dev (create a .env file with your `BOT_API_TOKEN first)
  • Run all tests in watch mode with npm run test:watch

Deployment using CI/CD

  • Deployment will only run if lint and tests pass
  • Push to master (or merge a PR) to deploy to Staging (@TestWhatCoinBot)
  • Create a release using npm run release to deploy to Prod (@WhatCoinBot)

Manual deployment

Run npm run deploy to build & deploy to a stack called "whatcoin-dev" using the BOT_API_TOKEN from your .env file.

This can be useful for troubleshooting build & deployment issues, or issues which only occur when running in AWS but not locally.

About

A telegram bot which provides cryptocurrency price and market info

Resources

Stars

Watchers

Forks

Packages

No packages published