DiscordPriceBot is a Discord bot that provides real-time pricing information for Arbitrove tokens. It fetches the latest price data from the Coingecko API and displays it as the bot's nickname in each server it is a member of. Additionally, it sets a custom activity status showing the 24-hour change percentage of the token's price.
- Fetches real-time pricing data for Arbitrove tokens from the Coingecko API.
- Sets the bot's nickname in each server to display the current token price.
- Sets a custom activity status showing the 24-hour change percentage of the token's price.
- Updates the token price and activity status periodically to reflect the latest data.
- Node.js (v16 or higher)
- Discord.js library
- dotenv library
- node-fetch library
-
Clone the repository and navigate to the project directory.
-
Install the dependencies by running the following command:
npm install
-
Create a
.env
file in the project directory and add the following environment variables:CLIENT_TOKEN=YOUR_DISCORD_BOT_TOKEN
COIN_ID=ARBITROVE_COIN_ID
PORT=YOUR_LOCAL_PORT
Note:
PORT
only needs to be set if the default8080
is in use. -
Replace
YOUR_DISCORD_BOT_TOKEN
with your Discord bot token,COIN_ID
with the Coin ID you wish to track 4. Run the bot by executing the following command:node index.js
-
Run the bot using:
npm start
-
Run tests using:
npm test
The bot will now be online and start updating the nickname and activity status in the specified guild.
- You can modify the interval at which the bot updates the token price and activity status by changing the value of the
setInterval
function in the code. - You can update the token by changing
COIN_ID
in your.env
file - You can update the % change in the tokens value by setting the query parameters in the get request from coingecko
- To customize the activity type and format, refer to the Discord.js documentation.