NFT Discord Bot
Want to go straight to the code?
Reservoir Discord Bot provides communities easy to use commands and alerts for their
Discord server, which can be expanded and customized to their liking. Come test the bot out now in the Reservoir discord server!
The Discord bot ships with the following functionality:
- Automated alerts for new listings, sales, floor listings, and top collection bids
- Collection search to view stats, current top bid, and current floor price
/collection [name: collection name to search for (ex. forgotten runes)] [limit: number of collections to return]
Getting Started
Prerequisites
- Install Node.js and NPM
- Request a free Reservoir API Key
- Setup a Discord application and bot
Built With
Installation
Method 1: Docker Setup (Recommended)
- Install Docker
- Fork this repository, and follow these instructions to get your Discord bot running
# Copy env vars sample file
cp .env.sample .env
# Set env vars in editor of your choice
vim .env
# Set constants in editor of your choice
vim src/utils/constants.ts
# Create and start the docker container
docker compose up -d
Method 2: Manual Setup
- Install Redis and start the server on the default port (6379)
- Fork this repository, and follow these instructions to get your Discord bot running
# Copy env vars sample file
cp .env.sample .env
# Set env vars in editor of your choice
vim .env
# Set constants in editor of your choice
vim src/utils/constants.ts
# Download dependencies
npm install
# Start the Discord bot
npm run start
Configuration
Environment Variables
Environment Variable | Description | Example |
---|---|---|
TOKEN | Your Discord bot's token | NzkyNzE1NDU0MTk2MDg4ODQy.X-hvzA.Ovy4MCQywSkoMRRclStW4xAYK7I |
RESERVOIR_API_KEY | Reservoir API key provided by the Reservoir Protocol. Get your own API key. | 123e4567-e89b-12d3-a456-426614174000 |
Constants
Constant | Description | Default |
---|---|---|
ALERT_COOLDOWN | Number of seconds to wait before sending a new floor price or top bid alert | 60 * 30 (30 minutes) |
PRICE_CHANGE_OVERRIDE | Percentage change in floor price to override alert cooldown | 0.1 (10%) |
ALERT_ENABLED | Enable/disable new listings, sales, floor price, and top bid alerts | listings: false, sales: false, floor: true, bid: true |
APPLICATION_ID | Your Discord application id | 5736050287834562 |
CHANNEL_IDS | The Discord channels you want the bot active in | 123456789098765432 |
ALERT_CONTRACT | The contract address of the collection you want to be alerted of floor price and top bid changes | 0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb |
TRACKED_CONTRACTS | The contract address(es) of the collection(s) you want to be alerted of new listings and sales | [0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb] |
REDIS_HOST | Redis host to connect to (For Docker set to "redis") | 127.0.0.1 |
REDIS_PORT | Redis port to connect to (For Docker set to "6379") | 6379 |
Updated over 1 year ago