diff --git a/commands/games-sp/jeopardy.js b/commands/games-sp/jeopardy.js index 6f734b59..0f133bf1 100644 --- a/commands/games-sp/jeopardy.js +++ b/commands/games-sp/jeopardy.js @@ -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) { diff --git a/package.json b/package.json index 4ff6a38f..12ad204d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "119.23.4", + "version": "119.23.5", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {