Skip to content

Commit cbf8538

Browse files
Disable web preview for telegram webhook (#6719)
1 parent 2a0e86d commit cbf8538

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

models/webhook_telegram.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ import (
1717
type (
1818
// TelegramPayload represents
1919
TelegramPayload struct {
20-
Message string `json:"text"`
21-
ParseMode string `json:"parse_mode"`
20+
Message string `json:"text"`
21+
ParseMode string `json:"parse_mode"`
22+
DisableWebPreview bool `json:"disable_web_page_preview"`
2223
}
2324

2425
// TelegramMeta contains the telegram metadata
@@ -34,6 +35,7 @@ func (p *TelegramPayload) SetSecret(_ string) {}
3435
// JSONPayload Marshals the TelegramPayload to json
3536
func (p *TelegramPayload) JSONPayload() ([]byte, error) {
3637
p.ParseMode = "HTML"
38+
p.DisableWebPreview = true
3739
p.Message = markup.Sanitize(p.Message)
3840
data, err := json.MarshalIndent(p, "", " ")
3941
if err != nil {

0 commit comments

Comments
 (0)