Skip to content
This repository was archived by the owner on May 29, 2024. It is now read-only.

Commit 141999b

Browse files
committed
Add some docstring links to telegram documentation
1 parent a9250f0 commit 141999b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/client/telegram.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ type TelegramClient interface {
1717
AlertClient
1818
}
1919

20+
// TelegramConfig holds configuration details for creating a new Telegram client.
21+
// Token: The Bot Token provided by BotFather upon creating a new bot (https://core.telegram.org/bots/api).
22+
// ChatID: Unique identifier for the target chat (https://core.telegram.org/constructor/channel).
2023
type TelegramConfig struct {
2124
Token string
2225
ChatID string
@@ -78,6 +81,7 @@ func (tc *telegramClient) PostEvent(ctx context.Context, data *AlertEventTrigger
7881
return nil, err
7982
}
8083

84+
// API endpoint "https://api.telegram.org/bot%s/sendMessage" is used to send messages (https://core.telegram.org/bots/api#sendmessage)
8185
url := fmt.Sprintf("https://api.telegram.org/bot%s/sendMessage", tc.token)
8286
req, err := http.NewRequestWithContext(ctx, "POST", url, bytes.NewReader(payloadBytes))
8387
if err != nil {

0 commit comments

Comments
 (0)