Skip to content

Flask webpage to verify NFT ownership and assign Discord roles

Notifications You must be signed in to change notification settings

choisangh/flask-discord-nft-verifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flask-Discord-NFTVerify

The goal of this project is to build a web application that authenticates NFT ownership and integrates with Discord using Flask. test

Project Structure

This project is structured as follows:

  • discord: contains code related to the Discord integration.
  • web3: contains code related to the web3 utils.
  • templates: contains the HTML templates for the web application.
  • static: contains the static files for the web application, such as CSS and JavaScript files.
  • config.py: contains the configuration variables for the application.
  • app.py: contains code related to the Flask web application.
  • main.py: the entry point for the Flask application.

Web3 Authentication

In this project, we implement web3 authentication using web3py lib. The nft folder contains the necessary code to authenticate the ownership of an NFT.

Discord Integration

In this project, we integrate with Discord using the Discord API. The discord folder contains the necessary code to interact with Discord, such as sending a message to a Discord channel.

Flask Web Application

In this project, we build a web application using Flask. The app folder contains the necessary code to build the web application, including the routes and controllers. The templates folder contains the HTML templates for the web application, and the static folder contains the static files for the web application, such as CSS and JavaScript files.

Configuration

Before running the application, make sure to set the configuration variables in the config.py file. This includes Discord Bot Token and the Discord webhook URL.

How to Run

To run this project, follow these steps:

  1. Set the configuration variables in the config.py file.
class WebConfig:
    REDIRECT_URI = "insert your web uri"


class Web3Config:
    WEB3_PROVIDER_URI = "insert web3 provider uri"
    CONTRACT_ADDRESS = "insert ERC-721 CA"
    ABI = "insert ABI"


class DiscordConfig:
    CLIENT_ID = "insert your discord client id"
    CLIENT_SECRET = "insert your discord client secret key"
    API_URI = 'https://discord.com/api'
    BOT_TOKEN = "insert your discord bot token"
    DISCORD_ROLE_ID = "insert discord role id"
    DISCORD_SERVER_ID = "insert discord server id"
  1. Run the main.py file to start the Flask web application.
  2. Access the web application in a web browser.

About

Flask webpage to verify NFT ownership and assign Discord roles

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published