Report Blank Jeopardy Questions/Answers

This commit is contained in:
Dragon Fire
2020-09-13 22:20:26 -04:00
parent 798ac7a574
commit 7f457c33c9
2 changed files with 14 additions and 2 deletions
+13 -1
View File
@@ -75,7 +75,19 @@ module.exports = class JeopardyCommand extends Command {
const { body } = await request
.get('http://jservice.io/api/random')
.query({ count: 1 });
return body[0];
const data = body[0];
if (!data.question || !data.answer) {
await this.markInvalid(data.id);
return this.fetchQuestion();
}
return data;
}
async markInvalid(id) {
const { body } = await request
.post('http://jservice.io/api/invalid')
.query({ id });
return body;
}
async generateClueCard(question) {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "119.23.4",
"version": "119.23.5",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {