fixed notifications dispatch
Some checks failed
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version Pipeline failed

This commit is contained in:
Stephan D
2025-11-19 20:15:36 +01:00
parent e08eb742e4
commit 29f5a56f21
11 changed files with 258 additions and 156 deletions

View File

@@ -33,7 +33,7 @@ type client struct {
botToken string
chatID string
threadID *int64
parseMode string
parseMode parseMode
}
type sendMessagePayload struct {
@@ -80,9 +80,9 @@ func NewClient(logger mlogger.Logger, cfg *notconfig.TelegramConfig) (Client, er
if apiURL == "" {
apiURL = defaultAPIURL
}
parseMode := strings.TrimSpace(cfg.ParseMode)
if parseMode == "" {
parseMode = "Markdown"
mode := normalizeParseMode(cfg.ParseMode)
if mode == parseModeUnset {
mode = parseModeMarkdown
}
return &client{
@@ -94,7 +94,7 @@ func NewClient(logger mlogger.Logger, cfg *notconfig.TelegramConfig) (Client, er
botToken: token,
chatID: chatID,
threadID: threadID,
parseMode: parseMode,
parseMode: mode,
}, nil
}
@@ -166,7 +166,7 @@ func (c *client) sendForm(ctx context.Context, template messageTemplate) error {
payload := sendMessagePayload{
ChatID: c.chatID,
Text: message,
ParseMode: c.parseMode,
ParseMode: c.parseMode.String(),
ThreadID: c.threadID,
DisablePreview: true,
}