Code Monkey home page Code Monkey logo

discordpricebot's Introduction

discordpricebot

A Discord Bot for displaying Token Prices on Binance Smart Chain

About

This bot will interface with both Discord and the BSC Network to continually keep a log of token prices.

Note that this will only report the mid-price; buying and selling the tokens will be lower/higher than the listed price.

Configuration

See config.yaml.example. The token ticker is the parent key of the configuration.

The web3 module requires all addresses to be checksummed; you can get the proper address from BSCScan.

Authorizing Discord User

  • Visit https://discord.com/developers/applications and create 'New Application'.
  • Set a worthy name
  • On the page that follows, set the account name and save. Then click Bot
  • Create a Bot account and Save. Click 'Copy' on the Token; this is the API Key you use in the bot script
  • Visit the OAuth2 tab. Under Scopes, select 'bot'
  • The resulting URL is what you (or anyone) use to add your bot instance to a server.

A single bot instance can be added to multiple servers; the bot's nickname (the price) will be updated on all registered servers.

Installation and Execution

This assumes you already have python3 and pip3 installed on your system.

Install the pre-requisites:
pip3 install -r requirements.txt

Due to limitations in the discord.py module, you cannot run all bots in one instance. Therefore, you will need to create a new instance for each token by passing the argument, such as nohup python3 main.py CAKE &.

Contributing

I need all the help I can get. PRs welcome.

TODO

  • Error handling (web3 and discord)
  • Better configuration (single entrypoint file referencing external configuration)
  • Recording historical movements in status message
  • Configurable status messages (e.g. comparing CRED price to THUGS value)

discordpricebot's People

Contributors

defidebauchery 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.