|
|
@ -19,6 +19,7 @@ type ( |
|
|
|
TelegramPayload struct { |
|
|
|
TelegramPayload struct { |
|
|
|
Message string `json:"text"` |
|
|
|
Message string `json:"text"` |
|
|
|
ParseMode string `json:"parse_mode"` |
|
|
|
ParseMode string `json:"parse_mode"` |
|
|
|
|
|
|
|
DisableWebPreview bool `json:"disable_web_page_preview"` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// TelegramMeta contains the telegram metadata
|
|
|
|
// TelegramMeta contains the telegram metadata
|
|
|
@ -34,6 +35,7 @@ func (p *TelegramPayload) SetSecret(_ string) {} |
|
|
|
// JSONPayload Marshals the TelegramPayload to json
|
|
|
|
// JSONPayload Marshals the TelegramPayload to json
|
|
|
|
func (p *TelegramPayload) JSONPayload() ([]byte, error) { |
|
|
|
func (p *TelegramPayload) JSONPayload() ([]byte, error) { |
|
|
|
p.ParseMode = "HTML" |
|
|
|
p.ParseMode = "HTML" |
|
|
|
|
|
|
|
p.DisableWebPreview = true |
|
|
|
p.Message = markup.Sanitize(p.Message) |
|
|
|
p.Message = markup.Sanitize(p.Message) |
|
|
|
data, err := json.MarshalIndent(p, "", " ") |
|
|
|
data, err := json.MarshalIndent(p, "", " ") |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|