You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+45-2Lines changed: 45 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ This repository contains a bot that monitors one or more Safe addresses for crit
6
6
-**Signing Transactions:** Monitors who signs the transactions and how many signatures have been collected.
7
7
-**Executing Transactions:** Sends alerts when a transaction is executed.
8
8
9
-
Additionally, the bot watches for any suspicious `delegateCall`. If a `delegateCall` is directed to an address other than the trusted `MultiSend` contract, the bot immediately flags it, helping to prevent attacks similar to the Bybit hack.
9
+
Additionally, the bot watches for any suspicious `delegateCall`. If a `delegateCall` is directed to an address other than the trusted `MultiSend` contract, the bot immediately flags it, helping to prevent attacks similar to the Bybit hack.
10
10
11
11
Real-time alerts are sent to a configured Telegram channel for immediate notification.
12
12
@@ -51,6 +51,49 @@ docker run -v $(pwd)/config.yaml:/app/config.yaml ghcr.io/gearbox-protocol/safe-
51
51
4. Once the bot is created, BotFather will provide you with an HTTP API token (e.g., `123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11`).
52
52
5. Copy this token and use it as the value for `telegramBotToken` in your `config.yaml`.
53
53
54
+
### Getting a Telegram Channel ID
55
+
56
+
1. Create a new channel or group in Telegram.
57
+
2. Invite your bot to the channel.
58
+
3. Send a message to the channel.
59
+
4. Use getUpdates (Testing Locally or Anywhere You Can Send HTTP Requests)
60
+
61
+
- Make a call to the [getUpdates](https://core.telegram.org/bots/api#getupdates) endpoint of the Bot API using your bot token. For example: https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates
62
+
63
+
The response is a JSON that contains “messages,” “channel_posts,” “callback_query,” or similar objects, depending on how your bot receives interactions.
64
+
65
+
5. Parse the JSON
66
+
67
+
- Look for the `"chat"` object inside each message (e.g., `"message"` or `"edited_message"`).
68
+
- The `"chat": { "id": ... }` field is the chat ID. For example, a response might look like:
69
+
70
+
```json
71
+
{
72
+
"ok": true,
73
+
"result": [
74
+
{
75
+
"update_id": 123456789,
76
+
"message": {
77
+
"message_id": 12,
78
+
"from": {
79
+
...
80
+
},
81
+
"chat": {
82
+
"id": 987654321,
83
+
"first_name": "John",
84
+
"type": "private"
85
+
},
86
+
"date": 1643212345,
87
+
"text": "Hello"
88
+
}
89
+
}
90
+
]
91
+
}
92
+
```
93
+
94
+
In this snippet, 987654321 is the telegramChannelId.
95
+
.
96
+
54
97
### Running via Docker
55
98
56
99
Run the Docker container with your config file mounted using the following command:
@@ -67,4 +110,4 @@ This project is distributed under the MIT License.
67
110
68
111
## Disclaimer
69
112
70
-
This software is provided "as is," without warranties or guarantees of any kind. Use it at your own risk. The maintainers and contributors are not liable for any damages or losses arising from its use. Always exercise caution and follow best security practices when managing crypto assets.
113
+
This software is provided "as is," without warranties or guarantees of any kind. Use it at your own risk. The maintainers and contributors are not liable for any damages or losses arising from its use. Always exercise caution and follow best security practices when managing crypto assets.
0 commit comments