Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation


sequence_logo

Sequence Wallet Discord Verification Bot

A Discord Bot for assigning your own server roles to users who link their wallets and verify their NFT ownership.

· Report Bug · Request Feature

Features

  • Wallet Linking: Users can link their wallets to their Discord accounts securely.
  • NFT Ownership: Verifies the ownership of NFTs in linked wallets.
  • Discord Role: Automatically assigns your server's roles based on the verified NFT ownership.
  • Changes of Ownership: When an NFT is acquired or transferred from/to the linked wallet, the wallet owner's roles in the server will be updated automatically.

Getting Started

Prerequisites

  • You will need an AWS account to start. Head over to Amazon Web Services and create a free account if you don't have one already.
  • Create a public S3 bucket in your AWS account and upload to it your bot images.
  • Make sure you have Developer Mode enabled for you in your server. How to enable developer mode
  • Create a dedicated verification channel. The channel shouldn't allow sending messages/threads/files,reactions,etc. as the bot will always communicate with the server members via private threads or DMs and any interaction single users make in the channel will make the bot's main message unreachable.
    Set @everyone permissions in this channel to X and allow only "View Channel".

TIP:You can keep the channel private while you test your bot, and open it once you are happy with your setup.

  • The role you will be giving to users that link their wallets with their discord accounts. It can be an existing role or a new one.
  • The roles you want to assign to NFT holders, depending on the NFT series. It can be a single role or a collection of roles. NOTE: The Bot will assign the roles that correlates to all owned NFTs series. Roles are accumulative.

Images

You need to provide your own images for the following parts of the bot:

  • Verification Channel Embed
  • Verification Page Background and Logo
  • Sequence Modal

Permissions

Verification Channel - Server

  1. Send Messages
  2. Delete Threads
  3. Create Threads

Gateway Intents

  1. GUILD_MEMBERS

Bot Permissions

  1. GENERAL PERMISSIONS -> Manage Roles
  2. GENERAL PERMISSIONS -> Read Messages/View Channels
  3. TEXT PERMISSIONS -> All minus Emojis/Stickers
  4. VOICE PERMISSIONS -> None

NOTE: Make sure the bot role (server) is higher on the roles hierarchy than the roles the users interacting with the bot in your server, to allow the bot to assign roles to these users: Server Roles Hierarchy

Environment Variables

For the bot to work correctly, you will need to provide the following variables in an .env file Check Discord guides for detailed information on how to obtain some of them and use the example files included in this repo as template:

example_local_env_vars.json (root)
.example-env (wallet_verify_bot & wallet_verify_front-end projects)

DISCORD ACCESS VARIABLES

  • APP_CLIENT_ID = ID of the app created in the Discord Developer portal - https://discord.com/developers/applications, select the bot, copy APPLICATION ID
  • BOT_TOKEN = Token used by the bot to respond to actions - https://discord.com/developers/applications/{APP_CLIENT_ID}/bot (obtainable only on "Reset Token")
  • WEBHOOK_ID = used by the lambdas to send messages in Discord threads
  • WEBHOOK_TOKEN = used by the lambdas to send messages in Discord threads Make sure you assign an understandable name to your webhook (i.e.: "Wallet Verification Bot") and select the verification channel in the CHANNEL drop-down

DISCORD SERVER VARIABLES

  • GUILD_ID = ID of your Discord server. Right-click on the Discord server name in the app, then select "Copy Server ID" - Needs developer mode enabled in the server
  • VERIFICATION_CHANNEL_ID = Used by the bot to interact on the verification channel - Right-click on the channel the bot will be, "Copy Channel ID"
  • PUBLIC_EMBED_IMAGE_URL = The splash image that will be shown in the verification channel public embed emitted by the bot on startup

DISCORD ROLES VARIABLES

  • WALLET_VERIFIED_ROLE_ID= The role a user that has completed their wallet verification will be assigned to
  • NFT_ROLES: A mapping between an NFT series and a role/role name in your Discord Server

AWS VARIABLES

  • DB_TABLE_NAME = DynamoDB table name
  • REGION = AWS region
  • ACCESS_KEY = Used by the bot and front end to access the bot's database and to publish to SNS - Linked to user in AWS
  • SECRET_ACCESS_KEY = Used by the bot to access the db when checking the wallet and to publish to SNS - Linked to user in aws
  • WALLET_VERIFIED_TOPIC_ARN = Topic ARN used by the front end to publish messages
  • NEXT_PUBLIC_BUCKET_NAME = the S3 bucket where you host images (front end/bot/etc.)

STYLE/TEXT VARIABLES

  • BLUE_COLOR & RED_COLOR & GREEN_COLOR & YELLOW_COLOR = A list of string hex colors used in the embeds/messages. e.g.: "#4C4C4C"
  • NEXT_PUBLIC_INDEX_TITLE = Wallet verification page title
  • NEXT_PUBLIC_CONNECT_WALLET_MAIN_MESSAGE = Main text in verification page
  • NEXT_PUBLIC_DONE_ICON_URL = OK icon to be shown when the verification process is successful
  • NEXT_PUBLIC_WARN_ICON_URL = Warning icon to be shown when the verification process was not successful
  • NEXT_PUBLIC_LOGO_URL = Your logo, shown at the top-left of the verification page
  • NEXT_PUBLIC_BACKGROUND_IMAGE_URL = Background image in the verification page

SEQUENCE

  • NETWORK = Used by Sequence's popup to authenticate the user in the correct network
  • NEXT_PUBLIC_CONNECT_WALLET_SEQUENCE_APP_NAME = Your app/server name
  • NEXT_PUBLIC_CONNECT_WALLET_SEQUENCE_THEME = https://docs.sequence.xyz/sdk/sequence-kit/configuration#available-options
  • NEXT_PUBLIC_CONNECT_WALLET_SEQUENCE_BANNER_URL = The url to the image you want as Sequence popup header

See Sequence Modal Config

OTHER VARIABLES

  • NODE_ENV = Used by local development only. NOT NEEDED for deployment!
  • LOG_LEVEL and NEXT_PUBLIC_LOG_LEVEL = Sets logger level. If not set, it defaults to info
  • JWT_SECRET = Shared between the front end and the bot, to sign (bot) and check (front end) the token generated by the bot - Can be whatever you like. Keep it hard to guess!
  • ISSUER = Your discord server or app name, used to generate the JWT token
  • VERIFICATION_PAGE_URL = URL to the verification page, used by the bot to provide the verification page link
  • SUPPORT_EMAIL= Your support contact email used in embeds/messages
  • NFT_MARKETPLACE= URL where your server members can buy an NFT

SSM Parameters

  • Navigate to AWS SSO Account selection page and select the account where you are deploying the bot
  • Select Command line or programmatic access
  • Select your OS and copy Option 1 and paste it into a terminal / CMD | PS prompt window in the bot's root directory
  • Ensure you have an up to date json file with all parameters - Check the file example_parameters_dev.json included in this repo as guidance.
  • Execute the parameters script with the name of your json file - e.g.:
python3 .github/scripts/update_parameters.py parameters_dev.json
  • You can also insert the values manually in AWS Parameters store: https://{your-region}.console.aws.amazon.com/systems-manager/parameters/?region={your-region}&tab=Table

SSM

Infra

Infra

Deployment

[TBD]

Interactions Flow

Interactions Flow

Guides & Documentation

For more information, please refer to our Guides and Docs

Discord guides

Roadmap

  • Unlink Wallet
  • URL Shortener

See the open issues for a full list of proposed features (and known issues).

Contact

Join Our Discord Server or write to our Support Email

Built With

  • TypeScript Next.js Discord.js
  • Amazon Web Services JWT npm Docker
  • Terraform ESLint Postman

Thanks to

(back to top)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages