summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-05-12 16:57:38 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-05-13 23:33:44 +0200
commit3b0828ed33e636cc3c7bfcdb0218305adc6d654a (patch)
tree517a58706e9328f2a5671216c0905007fefb065c
parent2dc9b39806c7842c31f941e7f7060f5e6b18af1c (diff)
downloaddiscordbot-3b0828ed33e636cc3c7bfcdb0218305adc6d654a.tar.gz
discordbot-3b0828ed33e636cc3c7bfcdb0218305adc6d654a.zip
migrate API changes2.3.0
-rw-r--r--api.js3
-rw-r--r--util.js6
2 files changed, 3 insertions, 6 deletions
diff --git a/api.js b/api.js
index 7f0c35d..7dc7b44 100644
--- a/api.js
+++ b/api.js
@@ -190,6 +190,7 @@ module.exports.upsearchPlayer = async (name) => {
}
// block until update is completely done
+// TODO implement & use
module.exports.upsearchPlayerSync = async (name) => {
const waiter = await api.subscribeUpdates(name);
await api.upsearchPlayer(name);
@@ -204,7 +205,7 @@ module.exports.upsearchPlayerSync = async (name) => {
module.exports.getMatches = async (name) => {
const data = await api.getFE("/player/" + name + "/matches/1.1.1.1", {},
60 * 60, "matches+" + name);
- return data[0].data;
+ return data.data;
}
// return single match
diff --git a/util.js b/util.js
index dccd874..c33d7b7 100644
--- a/util.js
+++ b/util.js
@@ -145,9 +145,5 @@ module.exports.paginate = function* chunks(arr, pagesize) {
module.exports.ignForUser = async (name, user_token) => {
// "?" is not accepted as user input, but the default for empty args
if (name != "?") return name;
- try {
- return await api.getUser(user_token);
- } catch (err) {
- return undefined;
- }
+ return await api.getUser(user_token);
}