This is a discord bot that uses coinmarketcaps api to get the quoted price converted to usd for a coin.
Go to the root of the project and type:
./gradlew.bat build
If on windows dont use ./
Once it is built you can navigate to build/libs, and you will see CoinMarketCapBot-1.2.jar
When you first run the bot it will create a app.config file. If you want to skip it automatically creating it place a file where the jar file is called app.config with the following:
#This is the coinmarketcap api key that you get from here https://coinmarketcap.com/api/
COINMARKETCAP_API_KEY=
#This is the discord guild id. You can get it by turning on developer mode by going to settings in discord -> Advanced -> Developer Mode
GUILD_ID=
#This is the symbol that is uses. Example HEX
COIN_TOKEN=
#This is the discord token you generate from the discord bot after creating a application in https://discord.com/developers/
DISCORD_TOKEN=
#The amount of time it takes before doing an update of the bots nickname and activity
INTERVAL_MINUTES=15
#The presence message type is price percentage changed in 24 hours. Change it to any of the following below
PRESENCE_MESSAGE_TYPE=percent_change_24h
#This will determine the decimal placement on the price
PRICE_FORMAT=0.00
- price - Price of the coin
- volume_24h - Volume of trades in the last 24 hours
- volume_change_24h - Volume percentage changed in the last 24 hours
- percent_change_1h - Price percentage changed in the last hour
- percent_change_24h - Price percentage changed in the last 24 hours
- percent_change_7d - Price percentage changed in the last 7 days
- percent_change_30d - Price percentage changed in the last 30 days
- percent_change_60d - Price percentage changed in the last 60 days
- percent_change_90d - Price percentage changed in the last 90 days
- market_cap
- market_cap_dominance
- fully_diluted_market_cap
yum -y update
yum install java-1.8.0-openjdk
sudo apt-get update
sudo apt-get install openjdk-8-jdk
brew install --cask java8
https://www.oracle.com/java/technologies/javase/javase8u211-later-archive-downloads.html
java -jar CoinMarketCapBot-1.1.jar
Go to https://coinmarketcap.com/api/ and click the button "GET YOUR API KEY NOW". It takes less than 5 min to setup.
It is also FREE.
CoinMarketCap offers 10,000 requests a month with 333 request per day.
So you can set the INTERVAL_MINUTES to 5 mintues and you will have enough free requests for a whole month.
Go to https://discord.com/developers/applications and click New Application. Once you have created a new application click into it if it does not navigate you to it. Then set the APP ICON. Next navigate to Bot and create a bot. Click the token reveal and copy it. You will be using this in the app.config.
Next navigate to the OAuth2
Copy the link and navigate to it. It will ask you to authorize the bot into the server.