đConfiguration
Learn about custom bots configuration structure
Configuration structure
Every custom bot configuration consists of:
Declaration at the top saying what type of event should trigger the bot ("trigger")
Preconditions block that states what conditions must be met by the event before it's forwarded to the condition blocks. It also gives special meaning to some of the conditions used here.
At least one condition block ("if") followed by the actions block ("then") that states what actions should be executed when the given condition is met
Example bot that sends a message to some Discord channel whenever HellCats NFT is sold:
Trigger
Declares on what type of event your bot should trigger. The following values are available:
listing
sale
Preconditions block
Here you can declare what conditions should be met by the event before it's forwarded to condition blocks. Some conditions that you put here have some special meaning:
"collection.address" - once your bot is started our monitors will start tracking this collection(s) on every marketplace we support.
"collection.name" - if your collection is a custom OpenSea collection, you'll need to enter its slug here so our monitor can start tracking it.
So by the rule of thumb:
When monitoring listings/sales of a single or more collections you should always put those conditions in a preconditions block to be sure that they are monitored.
Because of that you cannot use "not", "or", "!=" and "not in" keywords here as well as constants.
Condition and action blocks
Every condition/action block has the following structure:
Optional configuration options
You can use some optional constructs to make you bot more powerful:
Constants
Extensions
Constants
You can define constants in your bot that can be set to a fixed or dynamic (based on conditions) values:
What's more, you can use this constants in your message templates too! Let's take a following constant for example:
Depending on the price of listed NFT its value will be one of the icons above, and you may embed those icons in your template just by using the "{price_icon}" placeholder!
Extensions
Suppose that the "is_red" constant from the config above is defined not directly in the bot config, but in some extension. You may use this constant in your bot like this:
You can learn more about extensions here:
Last updated