From c60944e95bfea444b2999b839370e8f2af774eda Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 21 May 2021 23:12:28 -0400 Subject: [PATCH] Fetch wyr questions via JSON API --- commands/games-sp/would-you-rather.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/games-sp/would-you-rather.js b/commands/games-sp/would-you-rather.js index ba69292e..1e943744 100644 --- a/commands/games-sp/would-you-rather.js +++ b/commands/games-sp/would-you-rather.js @@ -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) {