Giter Club home page Giter Club logo

outfromviresbot's Introduction

OutFromViresBot

This code has been created to set up a Telegram channel to alert investors of new liquidations, repay or deposits in https://vires.finance/. It is based on a scraper of https://github.com/deemru/w8io.

The code is very hacky and it needs improvement. In the current state, an environment variable distinguishes the two modes of this bot:

  • TELEGRAM_BOT_ON = false -> the transactions are sent to stdout. [DEFAULT]
  • TELEGRAM_BOT_ON = true -> the transactions are sent to a Telegram channel by a bot.

Run bot

If the Telegram bot mode is enabled, two more variables are required:

  • TELEGRAM_BOT_ID: get this from BotFather. (E.g. 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11)
  • TELEGRAM_CHAT_ID: get this from the getUpdates function of the telegram bot. (E.g. -1000123456789)

You can use export to have them in the current shell session only:

export TELEGRAM_BOT_ON=true
export TELEGRAM_BOT_ID=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
export TELEGRAM_CHAT_ID=-1000123456789
python bot.py

This will obviously run until you close the shell.

If you want to run the bot in docker and forget about it, you can run the following command after changing the IDs with yours:

docker run -e TELEGRAM_BOT_ID=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11 -e TELEGRAM_CHAT_ID=-1000123456789 --restart unless-stopped -d andraghetti/vires-alerts

Development

In case you want to try the local mode without docker, you have to install the package and set the variables.

pip install --upgrade pip  # optional
pip install -e .
python bot.py

Known issues

  • The datetime is wrong (+1)
  • useless coloredlogs dependecy since this works on docker

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.