Alarm Notification Template

What is an Alert Notification Template?

In the ChainBot platform, an alert notification template is essentially a string of text with no length limitation. Whenever a user creates a Bot, a default alert notification template is generated. Users need to modify the keywords in the alert notification template according to their own needs, and they can also modify the injected variables based on the type of Bot monitoring.

Here is an example of an alert notification template:

[ {$bot.name} ]
  Contract: {$event.contract}
  Time: {$block.time}
  Explore: {$chain.explore}/tx/{$tx.hash}
  Created By ChainBot.io

In this example, "Contract" is a keyword designed for user readability, and "{$event.contract}" is a template variable. Template variables must be enclosed in "{}".

Learn about the different injected variables supported by Bot monitoring

Advanced Features of Alert Notification Templates

To use these features, users need basic programming skills.

1. Formatting Time

// Format the time zone to the user's designated time zone
timezone($block.time, 8)

2. Arithmetic Operations

"123000000000000000000" / 1e18 == 123
"1" + "1" + 1 == 3
2 - 1 == 1
2 * 2 == 4

3. Rounding Operations

{ round(1000000000001000000 / 1e18, 1)}

Complex Alert Template Example

[{$subscription.name}]
Block: {$block.number}
Values: {$values._reserve0 / 1e18} / {$values._reserve1 / 1e18} = {$values.percent}
Condition: {$condition}
Time: {$block.time}

Last updated