mirror of
https://github.com/CompeyDev/fxtwitter-docker.git
synced 2025-04-07 19:40:54 +01:00
Not sure how this got moved
This commit is contained in:
parent
0749e2d9b7
commit
21185c5686
1 changed files with 12 additions and 12 deletions
24
src/card.ts
24
src/card.ts
|
@ -70,19 +70,19 @@ export const renderCard = async (
|
||||||
values.choice4_count.string_value
|
values.choice4_count.string_value
|
||||||
);
|
);
|
||||||
totalVotes += parseInt(values.choice4_count.string_value);
|
totalVotes += parseInt(values.choice4_count.string_value);
|
||||||
|
|
||||||
for (const [label, votes] of Object.entries(choices)) {
|
|
||||||
// render bar
|
|
||||||
const bar = '█'.repeat(Math.round((votes / totalVotes || 0) * barLength));
|
|
||||||
str += `${bar}
|
|
||||||
${label} (${Math.round((votes / totalVotes || 0) * 100)}%)
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
|
|
||||||
str += `\n${totalVotes} votes · ${timeLeft}`;
|
|
||||||
|
|
||||||
console.log(str);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const [label, votes] of Object.entries(choices)) {
|
||||||
|
// render bar
|
||||||
|
const bar = '█'.repeat(Math.round((votes / totalVotes || 0) * barLength));
|
||||||
|
str += `${bar}
|
||||||
|
${label} (${Math.round((votes / totalVotes || 0) * 100)}%)
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
str += `\n${totalVotes} votes · ${timeLeft}`;
|
||||||
|
|
||||||
|
console.log(str);
|
||||||
/* Oh good, a non-Twitter video URL! This enables YouTube embeds and stuff to just work */
|
/* Oh good, a non-Twitter video URL! This enables YouTube embeds and stuff to just work */
|
||||||
} else if (typeof values.player_url !== 'undefined') {
|
} else if (typeof values.player_url !== 'undefined') {
|
||||||
headers.push(
|
headers.push(
|
||||||
|
|
Loading…
Add table
Reference in a new issue