From 6b6a97038a679eaa90ffd2430ff2d8b837a95338 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sat, 13 May 2017 23:36:18 +0200 Subject: backport API change from 2.3.1 This reverts commit 6b991150f4d8439f58da6eae32458c529a682029. --- responses.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'responses.js') diff --git a/responses.js b/responses.js index 582e85d..f4209fd 100644 --- a/responses.js +++ b/responses.js @@ -260,7 +260,7 @@ module.exports.showUser = async (msg, args) => { const waiter = api.subscribeUpdates(ign); while (await waiter.next() != undefined) { - const [player, stormcallerpleasefix] = await Promise.all([ + const [player, matches] = await Promise.all([ api.getPlayer(ign), api.getMatches(ign) ]); @@ -269,12 +269,11 @@ module.exports.showUser = async (msg, args) => { "Loading your data…", response); continue; } - if (stormcallerpleasefix == undefined || stormcallerpleasefix[0].data.length == 0) { + if (matches == undefined || matches.data.length == 0) { response = await respond(msg, "No match history for you yet", response); continue; } - const matches = stormcallerpleasefix[0]; const moreHelp = oneLine` *${emoji.symbols.information_source} or ${usg(msg, "vm " + ign)} for detail, -- cgit v1.3.1