🔀Functions

Fluff functions

You can use predefined functions in fluff to build more specific conditions in your bot. All available functions are listed below:

FunctionUsageDescription

contains

a) contains("abc", "c") b) contains("abc", ["a", "b"])

Checks if one string contains another

ends_with

a) ends_with("abc", "c") b) ends_with("abc", ["b", "c"])

Checks if one string ends with another

exists

a) exists(nft.traits["Hat"])

Checks if value exists

lower

a) lower(nft.name) == "xyz"

Returns lowercased string

max

a) max(1, 2) == 2

Returns max value

min

a) min(1, 2) == 1

Returns min value

mod

a) mod(nft.id, 2) == 0

Performs modulo operation

num

a) num(nft.id) == 123

Casts value to a number

random

a) random(1, 2) == 2 b) random(["a", "b"]) == "a"

Returns a random value

starts_with

a) starts_with("abc", "a") b) starts_with("abc", ["a", "b"])

Checks if one string starts with another

str

a) str(123) == "123"

Casts value to a string

upper

a) upper(nft.name) == "XYZ"

Returns uppercased string

Last updated