✏ī¸Message Templates

Message templates allow you to customize the way messages look and what information they contain.

Following message templates are supported:

📨Discord EmbedđŸĻTweet

Placeholders

Placeholders are used in message templates to embed various information from an event into your message.

Static placeholders

Static placeholders always resolve to the same value for the same event

NameSample valueEvents

buyer_address

0x249c134b254b119b42af0dccd31001258ea43274

Sale

buyer_address_short

0x24...3274

Sale

buyer_url

https://polygonscan.com/address/0x249c134b254b119b42af0dccd31001258ea43274

Sale

collection_address

0x09421f533497331e1075fdca2a16e9ce3f52312b

Listing, Sale

collection_name

HellCats

Listing, Sale

marketplace_chain

Polygon

Listing, Sale

marketplace_name

OnePlanet

Listing, Sale

nft_id

12345678901234567890

Listing, Sale

nft_id_short

1234...7890

Listing, Sale

nft_name

HellCat #540

Listing, Sale

nft_rank

344

Listing, Sale

nft_rank_top

13.8

Listing, Sale

nft_traits

â€ĸ Background: Purple (7.08%)

â€ĸ Fur: Ginger (5.52%)

â€ĸ Clothes: Varsity Jacket (3.6%)

â€ĸ Mouth: Teeth Grind (5.52%)

â€ĸ Eyes: Angry (7.28%)

â€ĸ Hat: Pierced Ear (5.44%)

Listing, Sale

nft_traits_no_rarity

â€ĸ Background: Purple

â€ĸ Fur: Ginger

â€ĸ Clothes: Varsity Jacket

â€ĸ Mouth: Teeth Grind

â€ĸ Eyes: Angry

â€ĸ Hat: Pierced Ear

Listing, Sale

nft_url

https://www.oneplanetnft.io/nfts/0x09421f533497331e1075fdca2a16e9ce3f52312b/540

Listing, Sale

price

4.69k

Listing, Sale

price_token

MATIC

Listing, Sale

price_usd

5.82k

Listing, Sale

seller_address

0x249c134b254b119b42af0dccd31001258ea43274

Listing, Sale

seller_address_short

0x24...3274

Listing, Sale

seller_url

https://polygonscan.com/address/0x249c134b254b119b42af0dccd31001258ea43274

Listing, Sale

timestamp_ms

1676401200000

Listing, Sale

timestamp_s

1676401200

Listing, Sale

token_standard

ERC-721

Listing, Sale

tx_hash

0x89c46e921a5d687e85c4953bdeeb5d224603f81924d0dff7c7e49d3d3beb898c

Listing, Sale

tx_url

https://polygonscan.com/tx/0x89c46e921a5d687e85c4953bdeeb5d224603f81924d0dff7c7e49d3d3beb898c

Listing, Sale

quantity

1

Listing, Sale

Place "\" character before the opening brace to escape the placeholder. E.g. "\{tx_hash}" will resolve to "\{tx_hash}" in the resulting message instead of "\0x89...b98c"

Dynamic placeholders

Dynamic placeholders resolve to different values based on a given key

NameUsageSample valueEvents

nft_trait

nft_trait[Color]

Purple

Listing, Sale

nft_trait_rarity

nft_trait_rarity[Color]

7.08

Listing, Sale

Placeholders from constants

You can use constants that you define in your custom bot configuration as placeholders in your message templates. Let's say you have such constant defined:

def price_icon = switch {
    case sale.price > $1000 => "💎💎💎"
    case sale.price >  $500 => "💎💎"
    case sale.price >  $100 => "💎"
    default                 => ""
}

You can use it in your message template as "{price_icon}" placeholder. It will resolve to 💎💎💎 for sales above $1000, 💎💎 for sales above $500, 💎 for sales above $100 and and empty text for the rest.

Last updated