Browse Source

Improve formatting of HTML rounds

pull/9/head
Abheek Dhawan 4 years ago
parent
commit
395caf5ed9
  1. 26
      bot/awesomescibo.js

26
bot/awesomescibo.js

@ -313,7 +313,7 @@ async function generateRound(message) {
} }
}); });
let i; let i;
let finalizedHTML = ""; let finalizedHTML = '<h4 style="text-align: center; text-decoration: underline overline; padding: 7px;">ROUND GENERATED BY AWESOMESCIBO USING THE SCIBOWLDB API</h4>';
for (i = 1; i < 26; i++) { for (i = 1; i < 26; i++) {
let tossup_question; let tossup_question;
let question_category; let question_category;
@ -333,28 +333,8 @@ async function generateRound(message) {
bonus_question = data.question.bonus_question; bonus_question = data.question.bonus_question;
bonus_answer = data.question.bonus_answer; bonus_answer = data.question.bonus_answer;
bonus_format = data.question.bonus_format; bonus_format = data.question.bonus_format;
htmlContent = htmlContent = `<br><br><p style="text-align: center;"><strong>TOSS-UP</strong></p>\n<br>` + `${i}) <strong>${question_category}</strong>` + " " + `<em>${tossup_format}</em>` + " " + tossup_question + "<br><br>" + "<strong>ANSWER:</strong> " + tossup_answer + "<br>";
`<br><br>${i}. Tossup\n<br><br>` + htmlContent += `<br><br><p style="text-align: center;"><strong>BONUS</strong></p>\n<br>` + `${i}) <strong>${question_category}</strong>` + " " + `<em>${bonus_format}</em>` + " " + bonus_question + "<br><br>" + "<strong>ANSWER:</strong> " + bonus_answer + "<br><br><hr><br>";
`<strong>${question_category}</strong>` +
" " +
`<em>${tossup_format}</em>` +
" " +
tossup_question +
"<br><br>" +
"<strong>ANSWER:</strong> " +
tossup_answer +
"<br><br>";
htmlContent +=
"<br><br>Bonus\n<br><br>" +
`<strong>${question_category}</strong>` +
" " +
`<em>${bonus_format}</em>` +
" " +
bonus_question +
"<br><br>" +
"<strong>ANSWER:</strong> " +
bonus_answer +
"<br><br>";
htmlContent = htmlContent.replace(/\n/g, "<br>"); htmlContent = htmlContent.replace(/\n/g, "<br>");
finalizedHTML += htmlContent; finalizedHTML += htmlContent;
if (i === 25) { if (i === 25) {

Loading…
Cancel
Save