A Discord Bot for displaying Token Prices
This bot will interface with both Discord and the xDai 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.
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 BlockScout.
- 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.
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 HNY &
.