Code Monkey home page Code Monkey logo

opensea-stream-discord-webhook's Introduction

opensea-stream-discord-webhook

A sample repo showing how a developer using the OpenSea Stream API might be able to connect a Discord webhook to send messages whenever new events occur for a collection.

This particular codebase tracks all event types for the collections in the Yuga Labs world of NFTs: Bored Ape Yacht Club, Bored Ape Kennel Club, Mutant Ape Yacht Club, and Otherdeed.

Setup

$ npm install

Fill out the .env file with:

  • The network you would like to use (mainnet or testnet)
  • The Discord webhook ID and token for the Discord you would like to send messages to.
  • To get a Discord webhook for your server, go to the channel you would like to add a webhook to and click the 'Edit Channel' button.
  • Click on the Integrations tab and then Webhooks
  • Click 'New Webhook' and give it a cool name + photo.
  • Click on 'Copy Webhook URL'. This will give a URL of the format https://discord.com/api/webhooks/{WEBHOOK_ID}/{WEBHOOK_TOKEN}, which you can now use in your .env file.
  • A list of collection slugs you would like to track events for, split with a space. To track all collections, use '*'.
  • e.g. COLLECTION_SLUGS="boredapeyachtclub mutant-ape-yacht-club otherdeed bored-ape-kennel-club"

Running locally

Assuming your set up above was completed successfully, run the following command to start the server:

$ npm run dev

To start a local dev server that tracks your local codebase and updates as you save changes. You can also run the server statically with npm run build && npm run start.

After the server starts running, go to localhost:PORT in your browser to start the bot.

Deploying

$ heroku create
Creating app... done, ⬢ pure-coast-44807
https://pure-coast-44807.herokuapp.com/ | https://git.heroku.com/pure-coast-44807.git

$ git push heroku main

opensea-stream-discord-webhook's People

Contributors

michael-cohen-io avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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