Change to escapeMarkdown
This commit is contained in:
parent
0a357be1b6
commit
3085c36718
1 changed files with 4 additions and 4 deletions
8
bot.go
8
bot.go
|
|
@ -418,13 +418,13 @@ func handleNewMessage(ctx context.Context, api *tg.Client, alertPeer *tg.InputPe
|
|||
chatName := channel.Title
|
||||
|
||||
// Build alert message with HTML formatting for markdown v2
|
||||
matchMessageHTML := fmt.Sprintf("🚨 Matched\n<b>Score</b>: %.2f\n<b>Chat</b>: %s (ID: %d)\n<b>User</b>: %s (%s) (ID: %d)\n",
|
||||
result.score, escapeHTML(chatName), chatID, escapeHTML(displayName+" ("+username+")"), username, senderID)
|
||||
matchMessageHTML := fmt.Sprintf("🚨 Matched\n<b>Score</b>: %.2f\n<b>Chat</b>: %s (ID: %d)\n<b>User</b>: %s (ID: %d)\n",
|
||||
result.score, escapeMarkdown(chatName), chatID, escapeMarkdown(displayName+" ("+username+")"), senderID)
|
||||
|
||||
// Send ntfy notification if config set (use plain text for ntfy)
|
||||
if cfg.NtfyToken != "" || cfg.NtfyTopic != "" {
|
||||
plainMessage := fmt.Sprintf("🚨 Matched\nScore: %.2f\nChat: %s (ID: %d)\nUser: %s (%s) (ID: %d)\n",
|
||||
result.score, chatName, chatID, displayName+" ("+username+")", username, senderID)
|
||||
plainMessage := fmt.Sprintf("🚨 Matched\nScore: %.2f\nChat: %s (ID: %d)\nUser: %s (ID: %d)\n\n%s",
|
||||
result.score, escapeMarkdown(chatName), chatID, escapeMarkdown(displayName+" ("+username+")"), senderID, escapeMarkdown(msg.Message))
|
||||
notify(plainMessage, cfg.NtfyHost, cfg.NtfyTopic, fmt.Sprintf("Scam Alert: %s", chatName), 5, cfg.NtfyToken)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue