mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-11 15:57:50 +02:00
Report Blank Jeopardy Questions/Answers
This commit is contained in:
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "119.23.4",
|
||||
"version": "119.23.5",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user