fix: update poll data extraction logic to ensure both question and options are present

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Sarto
2026-04-26 17:38:40 +03:30
parent 2e9bd4df03
commit 2fe3c8b604
2 changed files with 13 additions and 12 deletions
+3 -4
View File
@@ -540,13 +540,12 @@ func extractPollData(n *html.Node) string {
}
}
})
if question == "" && len(options) == 0 {
// Only return poll if both question and at least one option exist
if question == "" || len(options) == 0 {
return ""
}
result := "📊 " + question
if len(options) > 0 {
result += "\n" + strings.Join(options, "\n")
}
result += "\n" + strings.Join(options, "\n")
return result
}