fedimbed: poll visual parity with nitter polls

This commit is contained in:
Cynthia Foxwell 2025-04-04 19:58:36 -06:00
parent 28fab3823a
commit 5b4b252c35
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -1285,11 +1285,11 @@ async function processUrl(msg, url, spoiler = false, command = false) {
poll.options
.map((o) => {
const percent = o.count / poll.total;
const bar = Math.round(percent * 30);
const bar = Math.round(percent * 32);
return `**${o.name}** (${o.count}, ${Math.round(percent * 100)}%)\n\`[${"=".repeat(bar)}${" ".repeat(
30 - bar
)}]\``;
return `**${o.name}** (${o.count}, ${Math.round(percent * 100)}%)\n\`${"\u2588".repeat(bar)}${" ".repeat(
32 - bar
)}\``;
})
.join("\n\n") + `\n\n${poll.total} votes \u2022 Ends <t:${Math.floor(poll.end.getTime() / 1000)}:R>`,
});