diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-05-12 16:57:38 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-05-13 23:33:44 +0200 |
| commit | 3b0828ed33e636cc3c7bfcdb0218305adc6d654a (patch) | |
| tree | 517a58706e9328f2a5671216c0905007fefb065c | |
| parent | 2dc9b39806c7842c31f941e7f7060f5e6b18af1c (diff) | |
| download | discordbot-2.3.0.tar.gz discordbot-2.3.0.zip | |
migrate API changes2.3.0
| -rw-r--r-- | api.js | 3 | ||||
| -rw-r--r-- | util.js | 6 |
2 files changed, 3 insertions, 6 deletions
@@ -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 @@ -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); } |
