Token Permissioned Roles
Guide to setting up token permissioned roles.
When configuring token permissioned roles, the following commands are your friend:

/lunar-configure add-nft-rule

Use /lunar-configure add-nft-rule to add an nft permissioned role to your server. Each nft permissioned role is composed of the following properties:
  • nft-address (required) : The contract address against which to check for nft ownership
  • role (required) : The role to give to users which meet this rule.
  • quantity (optional, 1 by default) : The quantity of matching nfts that a user must hold in order to meet the rule.
  • token-ids (optional, all by default) : A list of token ids that the rule is restricted to. This can be used to add nft trait based roles. Calculate the list of token ids specific to a trait (galactic glitch for example) and then pass these token ids in when creating a rule.
Example 1: /lunar-configure add-nft-rule nft-address: terra103z9cnqm8psy0nyxqtugg6m7xnwvlkqdzm4s4k role: @Galactic Citizen
This adds a rule which grants anybody with at least one galactic punk (the nft address points to the galactic punk contract) the role Galactic Civilian
Example 2: /lunar-configure add-nft-rule nft-address: terra103z9cnqm8psy0nyxqtugg6m7xnwvlkqdzm4s4k role: @Galactic Glitch quantity: 2 token-ids:["1","2","3","4","5","7"]
This adds a rule which grants anybody with at least two galactic punks with the specified token ids the role Galactic Glitch
The output of running /lunar-configure add-rule

/lunar-configure view-rules

Use /lunar-configure view-rules to view the rules currently configured for your server. Example response:
The ouput of running /lunar-configure view-rules

/lunar-configure remove-rule

Use /lunar-configure remove-rule to remove a previously added rule. Example response:
The output of running /lunar-configure remove-rule

Further Reading

To learn more about lunar assistant configuration commands, see the following reference:
Copy link
/lunar-configure add-nft-rule
/lunar-configure view-rules
/lunar-configure remove-rule
Further Reading