Giter VIP home page Giter VIP logo

erc-20-discord-price-bot's Introduction

ERC-20 Discord Price Bot

Displays the price of an Ethereum ERC-20 token in USD in the username of a Discord bot, and provides a /price command for members to query the current price.

The bot online in a server The bot's price command response

You can test out the bot for yourself here: discord.gg/rJQTV6gqcU

Usage

  1. Clone the repository
git clone https://github.com/reecehunter/erc-20-discord-price-bot
  1. Create your bot application in the Discord Developer Portal.

  2. Add the bot to your discord server using the URL generator in the Discord Developer Portal. It only needs the bot scope and the Send Messages permission.

  3. Copy the .env.example file.

cp .env.example .env
  1. Fill in all the variables in your new .env. All data needed can be found in the Discord Developer Portal, Moralis account settings, and your own brain.
# The secret token for your Discord bot
DISCORD_BOT_TOKEN=
# The client ID of your Discord bot
DISCORD_CLIENT_ID=
# The ID of the server you put the bot in
DISCORD_GUILD_ID=

# The color you want the price command embed to have
EMBED_COLOR=15158332

# Moralis API key
# (Free API, just sign up for Moralis)
MORALIS_API_KEY=

# Name of the token to be displayed on the bot
TOKEN_NAME=$APE
# The smart contract address of the token
TOKEN_ADDRESS=0x4d224452801aced8b2f0aebe155379bb5d594381
# The chain the token is on
TOKEN_CHAIN=0x1

# How often the bot checks the price of the token in milliseconds
# (Discord has a rate limit)
UPDATE_FREQUENCY=3600000
  1. Install dependencies
npm install
  1. Deploy the price command
npm run deploy-commands
  1. Build the project
npm run build
  1. Start it up
npm run start

Your bot is now running!

Contributing

Feel free to make a pull-request to add a feature or improve the current code.

erc-20-discord-price-bot's People

Contributors

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