Fetch wyr questions via JSON API

This commit is contained in:
Dragon Fire
2021-05-21 23:12:28 -04:00
parent 5ed3901f9d
commit c60944e95b
+2 -2
View File
@@ -63,8 +63,8 @@ module.exports = class WouldYouRatherCommand extends Command {
}
async fetchScenario() {
const { text } = await request.get('http://either.io/');
return JSON.parse(text.match(/window.initial_question = (\{.+\})/)[1]).question;
const { text } = await request.get('http://either.io/questions/next/');
return JSON.parse(text).questions[0];
}
async postResponse(id, bool) {