mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +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() {
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user