mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 10:25:11 +02:00
Fetch wyr questions via JSON API
This commit is contained in:
@@ -63,8 +63,8 @@ module.exports = class WouldYouRatherCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fetchScenario() {
|
async fetchScenario() {
|
||||||
const { text } = await request.get('http://either.io/');
|
const { text } = await request.get('http://either.io/questions/next/');
|
||||||
return JSON.parse(text.match(/window.initial_question = (\{.+\})/)[1]).question;
|
return JSON.parse(text).questions[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
async postResponse(id, bool) {
|
async postResponse(id, bool) {
|
||||||
|
|||||||
Reference in New Issue
Block a user