Giter Site home page Giter Site logo

secret-discord-nft-verify's Introduction

How it works

Screen.Recording.2022-04-19.at.9.57.35.PM.mov

What this sample code does

  • Uses a ReactJs app to
    • Take in a user's discord tag
    • Creates a signing signature and the tokenId of a Secret Network NFT they hold related to the set contract address and makes a request to a nodejs api
  • Uses a NodeJs api to
    • Validate that the user is the owner of the Secret Network NFT sent to the POST
    • Adds a role to the user in the set Discord Guild if the user's tag exists and is in the guild already
    • Send a private message from the bot to the user letting them know they have a new role.

Configuring Bot

  • Create an application in the discord developer portal.
  • Select the bot tab
    • Check the boxes for Manage Roles and Send Messages permissions
    • Guild_Member privledged gateway must be turned on to query for guild Members
  • Then generate an api Token
  • Click on OAuth2 URL Generator and select bot. Then check the boxes for Manage Roles and Send Messages permissions again.
  • Use the generated url to add the bot to your discord server.
  • Make sure the bot has a role that is higher than the roles it will assign or else you will get a 403 error

Update the .env with your values

REACT_APP_CHAIN_REST=""

REACT_APP_NFT_CONTRACT_ADDRESS=""

secret-discord-nft-verify's People

Contributors

coryales avatar

Stargazers

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