Vibrant Documentation
  • ๐Ÿ‘‹Welcome to Vibrant
  • Overview
    • ๐Ÿ’กWhat we do
    • โ›“๏ธSupported Blockchains
    • โœจOur Features
    • ๐Ÿ™ŒFree Version
  • Discord Basics
    • ๐Ÿ› ๏ธGetting set up
      • ๐Ÿค–Inviting the bot
      • ๐Ÿ“Setting permissions
      • โœ…Verification Setup
    • โฉNext steps
    • ๐ŸŽจCustomize your Community
  • Guides
    • ๐ŸŽจFor NFT projects
      • ๐ŸงชPre-Mint
      • ๐ŸงฑMint
      • ๐Ÿš€Post launch
      • ๐Ÿ™๏ธCommunity Building
      • โญAdvanced Token Roles
      • ๐ŸคConnect with other Communities
    • ๐ŸŒŠFor Stakepools
      • ๐Ÿง‘Delegation Roles
      • โ•Stakepool Updates
      • ๐Ÿ™๏ธCommunity Building
    • ๐Ÿ“ˆFor DeFi Projects
      • ๐Ÿง‘Token Roles
      • ๐Ÿ™๏ธCommunity Building
    • ๐ŸคFor DAOs
      • ๐Ÿง‘Token Roles
      • ๐Ÿ—ณ๏ธVoting and Decisions
      • ๐Ÿ™๏ธCommunity Building
  • Discord Commands
    • User Commands
      • General
        • โ”/help
        • โ„น๏ธ/info
        • ๐Ÿ›ก๏ธ/policyid
        • ๐Ÿ—ณ๏ธ/vote
        • ๐Ÿง‘/whois
        • ๐Ÿˆ/premium
        • ๐Ÿ›’/claim
      • Verification
        • โ”/verify help
        • ๐Ÿ“ƒ/verify list
        • โž•/verify add
        • ๐Ÿ”—/verify link
        • โšก/verify unlink
        • ๐Ÿ›‘/verify cancel
        • ๐Ÿ—‘๏ธ/verify remove
      • Whitelist Signup
        • ๐Ÿ“ƒ/whitelist list
        • ๐Ÿ—ณ๏ธ/whitelist register
        • ๐Ÿ—‘๏ธ/whitelist unregister
      • Messaging
        • ๐Ÿ“ฉ/ping send
        • ๐Ÿ“ƒ/ping list
      • Profile
        • ๐Ÿ”ฒ/profile toggle
        • ๐Ÿ“›/profile defaulthandle
    • Admin Commands
      • General Administration
        • โ–ถ๏ธ/start
        • ๐Ÿ“ข/configure-social announce
        • โœ”๏ธ/configure-verify announce
      • Policy IDs
        • ๐Ÿ“ƒ/configure-policyid list
        • โž•/configure-policyid add
        • ๐Ÿ“ข/configure-policyid announce
        • ๐Ÿ”ข/configure-policyid mintcounter
        • ๐Ÿ—‘๏ธ/configure-policyid remove
      • NFT/Token Roles
        • ๐Ÿ“ƒ/configure-tokenroles list
        • ๐Ÿ”ค/configure-tokenroles details
        • โž•/configure-tokenroles add
        • ๐Ÿงช/configure-tokenroles test
        • โœ๏ธ/configure-tokenroles update
        • ๐Ÿ›ก๏ธ/configure-tokenroles policies add
        • โšก/configure-tokenroles policies remove
        • โž•/configure-tokenroles metadatafilter add
        • โšก/configure-tokenroles metadatafilter remove
        • ๐Ÿ—‘๏ธ/configure-tokenroles remove
      • Widgets & Info
        • โŒš/configure-info epochclock
      • Stakepools
        • ๐Ÿ“ƒ/configure-stakepool list
        • โž•/configure-stakepool add
        • ๐Ÿ—‘๏ธ/configure-stakepool remove
      • Delegator Roles
        • ๐Ÿ“ƒ/configure-delegatorroles list
        • โž•/configure-delegatorroles add
        • ๐Ÿงช/configure-delegatorroles test
        • ๐Ÿ—‘๏ธ/configure-delegatorroles remove
      • Polls and Votes
        • ๐Ÿ“ƒ/configure-poll list
        • โž•/configure-poll add
        • ๐Ÿ”—/configure-poll add-onchain
        • ๐Ÿ“ข/configure-poll announce
        • ๐Ÿง‘/configure-poll update addrole
        • โšก/configure-poll update removerole
        • ๐Ÿ—‘๏ธ/configure-poll remove
      • Giveaways
        • ๐Ÿ“ƒ/configure-giveaway list
        • โž•/configure-giveaway add
        • ๐Ÿ“ข/configure-giveaway announce
        • โน๏ธ/configure-giveaway end
        • ๐Ÿง‘/configure-giveaway update addrole
        • โšก/configure-giveaway update removerole
        • ๐Ÿ—‘๏ธ/configure-giveaway remove
      • Whitelists
        • ๐Ÿ“ƒ/configure-whitelist list
        • โž•/configure-whitelist add
        • ๐Ÿ›‘/configure-whitelist close
        • ๐Ÿšช/configure-whitelist open
        • ๐Ÿ“ข/configure-whitelist announce
        • โœ๏ธ/configure-whitelist update
        • ๐ŸŽ/configure-whitelist share
        • ๐Ÿšซ/configure-whitelist unshare
        • ๐Ÿ”ฝ/configure-whitelist download
        • ๐Ÿ—‘๏ธ/configure-whitelist remove
      • Scam Protection
        • ๐Ÿ’ก/configure-protection status
        • ๐Ÿ’‚โ€โ™€๏ธ /configure-protection addressremove
        • ๐Ÿ‘‚/configure-protection auditchannel
      • Marketplace & Minting
        • ๐Ÿ›’Sales
          • ๐Ÿ“ƒ/configure-marketplace sales list
          • ๐Ÿ›’/configure-marketplace sales add
          • ๐Ÿ—‘๏ธ/configure-marketplace sales remove
        • ๐Ÿ’ฒListings
          • ๐Ÿ“ƒ/configure-marketplace listings list
          • ๐Ÿ’ฒ/configure-marketplace listings add
          • ๐Ÿ—‘๏ธ/configure-marketplace listings remove
        • ๐ŸงฑMint
          • ๐Ÿ“ƒ/configure-marketplace mint list
          • ๐Ÿงฑ/configure-marketplace mint add
          • ๐Ÿ—‘๏ธ/configure-marketplace mint remove
        • โž•/configure-marketplace metadatafilter add
        • ๐Ÿ—‘๏ธ/configure-marketplace metadatafilter remove
      • Settings and Premium
        • โš™๏ธ/configure-settings features
        • ๐ŸŽจ/configure-settings customize
        • โ™ฅ๏ธ/configure-healthcheck
        • โ„น๏ธ/configure-premium status
        • ๐Ÿ”‹/configure-premium refill
      • Admin Roles
        • ๐Ÿ“ƒ/configure-adminaccess list
        • ๐Ÿ”’/configure-adminaccess add
        • ๐Ÿ”“/configure-adminaccess remove
      • API Access
        • ๐Ÿšช/configure-api generatetoken
        • ๐Ÿ›ก๏ธ/configure-api removetoken
Powered by GitBook
On this page
  • Examples
  • Sample Metadata
  • Sample Metadata
  • Sample Metadata
  • Sample Metadata
  • Sample Metadata
  • Sample Metadata
  • Sample Metadata
  • Parameters

Was this helpful?

  1. Discord Commands
  2. Admin Commands
  3. NFT/Token Roles

/configure-tokenroles metadatafilter add

Add a metadata filter to an existing token role

Previous/configure-tokenroles policies removeNext/configure-tokenroles metadatafilter remove

Last updated 1 year ago

Was this helpful?

The /CONFIGURE-TOKENROLES METADATAFILTER ADD command is possibly one of the most powerful commands in the arsenal of an NFT project. It enables you to assign roles based on individual traits of NFTs for all of your verified holders. You can have none, one or multiple filters active at the same time and combine them in powerful ways, to target exactly the population of your holders you would like to. You can use it to exclude certain traits, find 1/1s, or give a role to those that own the Green underwear NFTs.

To get a metadata filter role working, simply start with the normal process of adding a token role via . After adding the role, you can add metadata filters via /CONFIGURE-TOKENROLES METADATAFILTER ADD. When adding a filter, you will be asked for four things. The token-role-id (which you can retrieve from ) is the first one and indicates which role the filter will be applied to. The attribute path is the second parameter and determines where in your metadata we will search for the specific attribute you would like to include or exclude. The operator specifies how we search for data in your retrieved attribute. Lastly, we ask for an attribute-value, meaning the content you want to include or exclude. A detailed explanation of all parameters is provided below our examples.

If you are not sure how to build the correct attribute-path or attribute-value, you can leverage our to help you out.

It is important to note that both attribute-path and attribute-value are case sensitive and need to exactly match your metadata. If your metadata attribute is Rarity, using an attribute-path rarity will NOT work.

When having special characters and whitespace in your attribute path, you may have to wrap your attribute names in double quotes or use a native JSONpath expression. Please see our examples below for specifics.

Examples

Here are a few detailed examples with prototype metadata and how to set up a filter for that specific case.

/configure-tokenroles metadatafilter addtoken-role-id 13attribute-path typeoperator equalsattribute-value Cat

With this metadata filter applied to token role ID 13 (which we have set up to include the Spacebudz policy and a count of 1), everyone will get the respective Discord role @BudzCat if they have a Spacebudz cat. The metadata that goes with this filter is as follows and our attribute-path is simply a first-level attribute.

Sample Metadata

{
  "arweaveId": "Bqt7gfA8AbD2O5oQC_PG8yYdIQj9wQD3SUVP4rhw_uA",
  "image": "ipfs://QmVYZPT3WWfeBzzYhEamneAFvTe85hPF4QH1qFJBwjfwHA",
  "name": "SpaceBud #2729",
  "traits": [
    "Chestplate",
    "Belt",
    "Covered Helmet",
    "Axe",
    "Pistol"
  ],
  "type": "Cat"
}

/configure-tokenroles metadatafilter addtoken-role-id 14attribute-path traitsoperator containsattribute-value Axe

With this metadata filter applied to token role ID 14 (which we have set up to include the Spacebudz policy and a count of 1), everyone will get the respective Discord role @AxeBud if they have a Spacebudz with "Axe" in the list of traits. With the attribute-path referencing a list of attributes (denoted by the [ ] brackets around the traits attribute content), we use the contains operator to match our text with the items in the list.

Sample Metadata

{
  "arweaveId": "Bqt7gfA8AbD2O5oQC_PG8yYdIQj9wQD3SUVP4rhw_uA",
  "image": "ipfs://QmVYZPT3WWfeBzzYhEamneAFvTe85hPF4QH1qFJBwjfwHA",
  "name": "SpaceBud #2729",
  "traits": [
    "Chestplate",
    "Belt",
    "Covered Helmet",
    "Axe",
    "Pistol"
  ],
  "type": "Cat"
}

/configure-tokenroles metadatafilter addtoken-role-id 14attribute-path traitsoperator containsattribute-value Axe/configure-tokenroles metadatafilter addtoken-role-id 14attribute-path traitsoperator containsattribute-value Pistol

In this case, we are applying TWO filters to our existing role for the Spacebudz policy. A user will now get the respective Discord role @DualWielder only if they have a Spacebudz that has both an "Axe" and a "Pistol" in the list of traits.

Sample Metadata

{
  "arweaveId": "Bqt7gfA8AbD2O5oQC_PG8yYdIQj9wQD3SUVP4rhw_uA",
  "image": "ipfs://QmVYZPT3WWfeBzzYhEamneAFvTe85hPF4QH1qFJBwjfwHA",
  "name": "SpaceBud #2729",
  "traits": [
    "Chestplate",
    "Belt",
    "Covered Helmet",
    "Axe",
    "Pistol"
  ],
  "type": "Cat"
}

/configure-tokenroles metadatafilter addtoken-role-id 15attribute-path attributes.Armoroperator starts withattribute-value Ice

If you have nested attributes like in this Tavern Squad NFT, you can simply access subattributes via a period. In our example we use attributes.Armor (not the case sensitive attribute names). In this case, we are filtering for any NFT where the Armor subattribute starts with the text Ice. This would include an Armor of the type Ice Chainmail but also any NFT with the Armor Ice Platemail or just Ice.

Sample Metadata

{
  "attributes": {
    "Armor": "Ice",
    "Back": "None",
    "Background": "Red",
    "Eyes": "Drowsy",
    "Face": "None",
    "Familiar": "None",
    "Head": "Flame",
    "Mouth": "Normal",
    "Race": "Human",
    "Racial": "Clean Shaven",
    "SkinTone": "C"
  },
  "id": 1813,
  "image": "ipfs://QmWcp43o3DguesCN1H5oJnwtZ32GTFM2F8Tb29qA2KsZiQ",
  "name": "Tavern Squad Adventurer #01813",
  "type": "image/png",
  "url": "https://tavernsquad.io"
}

/configure-tokenroles metadatafilter addtoken-role-id 16attribute-path properties[?(@.key=="type")].valueoperator equalsattribute-value dead

For a more complicated attribute-path, we are using the DEADPXLZ project as an example. In this case, the attribute path value is properties[?(@.key=="type")].value, which means in the list of properties, we find the entry where the key attribute is type, and of that object, we then ask for the value attribute and check if it equals dead.

Sample Metadata

{
  "image": "ipfs://ipfs/QmRrFYTD2k8LVLkxdmyyqnuAbKBY664mkisEgMzw7rxZTZ",
  "name": "PXL#500",
  "properties": [
    {
      "key": "type",
      "value": "dead"
    },
    {
      "key": "length",
      "value": "long"
    }
  ],
  "src": "ipfs://ipfs/QmVsmMgvn28UxuPecwKSsd2cTnjgkw9ZKtyNoV566UEUXt",
  "tags": [
    "soul patch",
    "smoking"
  ],
  "type": "text/html"
}

/configure-tokenroles metadatafilter addtoken-role-id 17attribute-path ["Jaw & Teeth"]operator equalsattribute-value Gold

When your attribute-path contains special characters or whitespace, you will need to use special square bracket expressions to match it. You will need to wrap your attribute name in brackets and double quotes, like in the above example. For your attribute path you would then use ["Attribute with Space"]. If you are nesting deeper and you have non-whitespace attributes in between, you can either use the same syntax or the dot-notation: ["Jaw & Teeth"].color["hue amount"] and ["Jaw & Teeth"]["color"]["hue amount"] are the same. Note there is no dot behind color in the first version.

Sample Metadata

{
  "Accessory": "Cross Bones",
  "Artist": "twitter.com/xjoshuajones",
  "Background": "Mint",
  "Base Skull": "Gold",
  "Eyes": "Robot Eyes",
  "Jaw & Teeth": "Gold",
  "Nemonium": "twitter.com/_nemonium",
  "Website": "nemo.global",
  "description": "Calvaria ",
  "name": "Skull_3439"
}

/configure-tokenroles metadatafilter addtoken-role-id 14attribute-path typeoperator equalsattribute-value Cattoken-weight 5/configure-tokenroles metadatafilter addtoken-role-id 14attribute-path typeoperator does not equalattribute-value Cattoken-weight 1

In this case, we are applying two filters with different token-weight to our existing role for the Spacebudz policy. A user will now get the respective Discord role @TenOrMore only if they have either two cats, ten non-cats or one cat and five non-cats (or anything else that adds up to ten or more).

Sample Metadata

{
  "arweaveId": "Bqt7gfA8AbD2O5oQC_PG8yYdIQj9wQD3SUVP4rhw_uA",
  "image": "ipfs://QmVYZPT3WWfeBzzYhEamneAFvTe85hPF4QH1qFJBwjfwHA",
  "name": "SpaceBud #2729",
  "traits": [
    "Chestplate",
    "Belt",
    "Covered Helmet",
    "Axe",
    "Pistol"
  ],
  "type": "Cat"
}

Parameters

Parameter
Details

token-role-id

attribute-path

The attribute name or JSON path within your NFT metadata that you would like to filter values for. See below for some common examples of attributes and respective metadata.

operator

Once the attribute has been extracted, what operator would you like to compare the value to. The operator can be one of the following:

equals

The text extracted from attribute-path must exactly match (case sensitive) the attribute-value. Use this only when the targeted attribute is a number or text.

does not equal

The text extracted from attribute-path may not be exactly the same (case sensitive) as the text provided via the attribute-value. Use this only when the targeted attribute is a number or text.

contains

The contains operator works with both text and list attributes (see examples below). If the data extracted from attribute-path is a text, the filter condition is met if it contains the text (case sensitive) provided via attribute-value.

If the data extracted from attribute-path is a list, the filter condition is met if any one of the items in the list exactly matches (case sensitive) the text from the attribute-value parameter.

does not contain

The does not contain operator works with both text and list attributes (see examples below). If the data extracted from attribute-path is a text, the filter condition is met if it does not contain the text (case sensitive) provided via attribute-value.

If the data extracted from attribute-path is a list, the filter condition is met if none one of the items in the list matches (case sensitive) the text from the attribute-value parameter.

starts with

The text extracted from attribute-path must start with the same (case sensitive) as the text provided via the attribute-value. Use this only when the targeted attribute is a number or text.

ends with

The text extracted from attribute-path must end with the same (case sensitive) as the text provided via the attribute-value. Use this only when the targeted attribute is a number or text.

attribute-value

The attribute value is what the filter will compare the content found via the attribute-path with. For more details, see examples and the explanation within the operator parameter above.

[token-weight]

An optional weight to give to tokens when using the aggregation-type Any policy of the role, each NFT must match at least one filter. A token matching this specific filter will count as this number of tokens towards the minimum count. If not provided, defaults to 1, which means it counts as one token.

Alternative 1: By running and changing the aggregation-type to OR, everyone who either has a Spacebud with an Axe or a Spacebud with a Pistol will be considered.

Alternative 2: By running and changing the aggregation-type to ONE OF EACH, users only receive the role if they have one NFT matching each attribute. This means only people that own two Spacebudz, one with an Axe and one with a Pistol, would be assigned the role. This can be used to create roles for people that own "one of each type".

Vibrant allows for very complex attribute paths and leverages the power of JSONpath to query any part of your metadata. Find more information in one of the many . You can play around and test your attribute-path with our .

We highly recommend to test your attribute-path with our first in this case.

Configuration: By running on our main role and changing the count to 10 and the aggregation-type to Any policy of the role, each NFT must match at least one filter, users only receive the role if they have a combined filtered token count of ten or more. This is best used with filters that are mutually exclusive, to enable weighted token roles based on metadata.

The token role ID to which you would like to add a metadata filter. You can find this ID via .

โž•
/CONFIGURE-TOKENROLE ADD
/CONFIGURE-TOKENROLES LIST
Metadata filter builder
/CONFIGURE-TOKENROLES UPDATE
/CONFIGURE-TOKENROLES UPDATE
JsonPath documentation pages
Metadata filter builder
Metadata filter builder
/CONFIGURE-TOKENROLES UPDATE
/CONFIGURE-TOKENROLES LIST