fix: markdown parse mode breaking some plugins
This commit is contained in:
parent
35c14ce8a8
commit
0edf41c792
5 changed files with 140 additions and 6 deletions
|
@ -233,9 +233,17 @@ func (t *TelegramPlatform) SendMessage(msg *model.Message) error {
|
|||
|
||||
// Prepare payload
|
||||
payload := map[string]interface{}{
|
||||
"chat_id": chatID,
|
||||
"text": msg.Text,
|
||||
"parse_mode": "Markdown",
|
||||
"chat_id": chatID,
|
||||
"text": msg.Text,
|
||||
}
|
||||
|
||||
// Set parse_mode based on plugin preference or default to Markdown
|
||||
if msg.Raw != nil && msg.Raw["parse_mode"] != nil {
|
||||
// Plugin explicitly set parse_mode
|
||||
payload["parse_mode"] = msg.Raw["parse_mode"]
|
||||
} else {
|
||||
// Default to Markdown for backward compatibility
|
||||
payload["parse_mode"] = "Markdown"
|
||||
}
|
||||
|
||||
// Add reply if needed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue