Message Formatting

Standard Message Formatting

All Alerts allow the user to configure a custom message. This message has access to variables and infomation associated with the alert.

Embedding links is simple! Discord uses the same syntax as markdown: [title](link)

[link here!](https://robolabs.biz)

Will display:

link here!

Accessing Variables

To access data in the message, use the syntax { variable } . For exmaple, the message:

Alert triggered at block {block}
Event: {event}
Transaction Hash: {txHash}

Would yeild the following message:

Alert triggered at block 102323

Event: StrategyReported

Trasnaction hash: 0x0785dfcd6a5a9ffdb30e60750a01d144a42306d48004410712476cc62c2d7997

Calculations in Messages

Denotify supports simple calculations in the string format. For example { block / 1000 } will calculate the block number divided by 1000 and format the result into the message. Currently addition, subtraction, multiplication and division are supported.

Supported Variables

All messages have access to a standard set of variables, and each trigger type has extended variables specific to the trigger. The table below details the standard set of variables

Standard Variables

VariableTypeDescription

block

number

blockchain block associated with the alert

Network

string

String name of the network. For example, ''Avalanche" or "Ethereum"

id

number

ID of the alert

triggered

boolean

true if the alert is set. false if it is cleared.

lastBlock

number

Block number that the alert was last tested

Extended Variables: Poll Function Trigger

VariableTypeDescription

nBlocks

number

Poll period. The frequency the trigger is tested.

address

string

address of the contract

fixedArgs

string[]

Array of fixed arguments configured for the trigger

responseArgIndex

number

index of the arg tested

responseArgDecimals

numner

decimals configured

function

string

function name configured to poll

conditions

string

condition symbol of the test

constant

number

constant used in conditional test

arg_[n]

number / string

arg_0 will return the first return value of the function, arg_1 will be the second, and so on.

Extended Variables: Onchain Event Trigger

VariableTypeDescription

address

string

contract address configured for the trigger

event

string

name of the Event being monitored

paramsIndex

number

index of the events' parameter taking part in the conditional test

paramsDecimals

number

configured decimals for paramsIndex

condition

string

condition symbol of the test

constant

number

constant used in conditional test

blockHash

string

block hash of the event detected

txHash

string

hash of the transaction

args_[n]

string / number

arg_0 will return the first parameter of the event, arg_1 will be the second, and so on.

Last updated