Skip to content

Commit 994d73a

Browse files
authored
feat(docs): reshape agent bot notifications guide to make it generic (#524)
1 parent f86998f commit 994d73a

File tree

2 files changed

+61
-24
lines changed

2 files changed

+61
-24
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
sidebar_position: 7
3+
slug: agent-bot-notifications
4+
title: Agent Bot Notifications
5+
description: Learn how to set up agent bot notifications for FAssets.
6+
tags: [intermediate, fassets, bitcoin, dogecoin]
7+
authors: [fassko]
8+
keywords: [fassets, xrp, btc, doge flare-network, flare-network]
9+
---
10+
11+
The agent bot can send notifications to a Telegram bot or API endpoint.
12+
It helps monitor the health of the agent and the network.
13+
14+
## Agent Bot Notifications Configuration
15+
16+
1. Add the following configuration to the `apiNotifierConfigs` list in the `config.json` file:
17+
18+
```json
19+
{
20+
"apiUrl": "NOTIFICATIONS_API_URL",
21+
"apiKey": "API_KEY",
22+
"level": "danger"
23+
}
24+
```
25+
26+
If the level field is omitted inside configuration, the bot will default it to `danger`.
27+
28+
2. The `apiUrl` field specifies the URL to send the notifications to.
29+
The bot will send the notifications as POST requests to the `/api/agent/botAlert` endpoint.
30+
31+
3. The `apiKey` is sent in the header under `x-apikey`.
32+
The `level` field specifies the minimum level of alerts to send.
33+
If the `level` field is omitted, the bot will default it to `danger`.
34+
35+
4. The agent bot can send notifications as POST requests to the endpoint `apiUrl/api/agent/botAlert` with the following body:
36+
37+
```typescript
38+
PostAlert = {
39+
bot_type: string,
40+
address: string,
41+
level: string,
42+
title: string,
43+
description: string,
44+
};
45+
```
46+
47+
## Flare Hosted Telegram Notifications Alert Configuration
48+
49+
1. Get the API key from the [FAssets Telegram Bot](http://t.me/FlareFAssetsSongbirdBot) by sending `/events` and selecting `Subscribe to Events`.
50+
2. Add the following configuration to the `apiNotifierConfigs` list in the `config.json` file, replacing `API_KEY` with the key obtained from the bot.
51+
52+
```json
53+
{
54+
"apiUrl": "https://fasset-tg-bot-songbird.flare.network",
55+
"apiKey": "API_KEY",
56+
"level": "danger"
57+
}
58+
```
59+
60+
Notifications will only be sent out for `danger` and `critical` levels, regardless of the configured level.
61+
This is enforced by the Telegram bot, which delivers priority messages due to heavy load.

docs/fassets/guides/7-telegram-bot-notifications.mdx

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)