miasmos / op.gg-api

Serves op.gg web pages as json.
MIT License
81 stars 21 forks source link

"TypeError: validate.Summoner is not a function" #9

Closed twardle closed 7 years ago

twardle commented 7 years ago

Whenever I make a function call that validates a summoner, I receive this error:

TypeError: validate.Summoner is not a function
    at opgg.Summary (C:\***\node_modules\op.gg-api\client.js:73:26)
    at Object.<anonymous> (C:\***\index.js:17:18)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:390:7)
    at startup (bootstrap_node.js:150:9)
    at bootstrap_node.js:505:3

The code I use to call it is simply just:

var opgg = new (require('op.gg-api/client.js'))
console.log('loaded')

var xayah = opgg.Summary('na', 'zuurah')
.then((json) => {
    console.log(json)
})
.catch((error) => {
    console.error(error)
})

Am I calling something improperly, or is the function just not working at the moment?