Git Product home page Git Product logo

discord-sidebar-price-bot's Introduction

discord-sidebar-price-bot

Inspired by pipercucu/DiscordSidebarPriceBot, these Python scripts can run Discord bots that pull live data at intervals and display it on the sidebar of a Discord guild (i.e. server). It currently supports:

  • Cryptocurrency price data (in USD, BTC, and/or ETH) from Coingecko API
  • Gas price of the Ethereum blockchain (in gwei) from Etherscan API
  • Forex price from exchangeratesapi
  • Crypto Fear & Greed Index from Alternate.me API

Dependencies

Recommended Python 3.7, although it should support Python >=3.5 <=3.9. Install all dependencies:

pip install -r requirements.txt

Test & Run

Cryptocurrency Price Bot

  1. Cache the cryptocurrency ticker list from Coincegko by generating a crypto_cache.json file.
python crypto_cache.py -v
  1. Configure crypto_config.yaml using the template provided. It requires a unique Discord bot key and (non-unique) Guild ID per bot. 1 sidebar bot per cryptocurrency (expressed by their ticker e.g. BTC, ETH, YFI). For each cryptocurrency, the price can be shown in USD, BTC, and/or ETH.

  2. Sometimes multiple coins or tokens share the same ticker (e.g. UNI). In this case, modify resolver_ambiguous_ticker() to specify the token you want.

  3. Run a cryptocurrency price bot:

python crypto_run.py -t BTC

Replace the ticker BTC with any cryptocurrency you have configured in Step 2.

Gas Price Bot

  1. Configure gas_config.yaml using the template provided. It requires a unique Discord bot key and (non-unique) Guild ID per bot. It also requires an Etherscan API key if you would like to use Etherscan API.

  2. Run a gas price bot using Etherscan API:

python gas_run.py -s etherscan

Forex Price Bot

  1. Configure forex_config.yaml using the template provided. It requires a unique Discord bot key and (non-unique) Guild ID per bot. 1 sidebar bot per forex pair (expressed by their ticker/ticker e.g. GBP/HKD).

  2. Run a forex price bot:

python forex_run.py -p GBP/HKD

Replace GBP/HKD with any forex pair you have configured in Step 1.

Crypto Fear & Greed Index

  1. Configure cfgi_config.yaml using the template provided. It requires a unique Discord bot key and (non-unique) Guild ID per bot.

  2. Run a bot:

python cfgi_run.py

Deploy

Once you are familiar with running a single sidebar bot, you can run multiple bots concurrently by calling ./bot.sh and kill all bots by calling ./kill.sh. You might want to modify the commands in ./bot.sh to suit your own needs.

discord-sidebar-price-bot's People

Contributors

edenau avatar rafitamolin avatar

Watchers

 avatar

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.