mirror of
https://github.com/sartoopjj/thefeed.git
synced 2026-05-19 07:04:37 +03:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user