Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'GamerCard' of undefined #3

Open
DasCalamity opened this issue Apr 17, 2017 · 7 comments
Open

TypeError: Cannot read property 'GamerCard' of undefined #3

DasCalamity opened this issue Apr 17, 2017 · 7 comments

Comments

@DasCalamity
Copy link

api.profile({
gamertag : 'Pravdin Linda'
}, function(err, user){
if (err) return console.error(err);
message.channel.send(user);
}); was my code, I am not sure if this is a issue or not...

@khrome
Copy link
Owner

khrome commented Apr 29, 2017

Just saw this, I'll look at it this weekend.

@DasCalamity
Copy link
Author

Alright I forgot to say it had something to do with "var api = new XBoxLive.Source.GamerCard();"

@khrome
Copy link
Owner

khrome commented May 1, 2017

So I was able to look at it this weekend: and I have some bad news: 1 - the docs are wrong and it's .Service rather than .Source... but this might not help you because 2 - it seems the Gamercard endpoints now are 360 specific and linked to your application code (try logging into an xbox 360 after enabling 2 factor auth on your MS account for a crash course on this). So the data you get back may not be exactly what you expect if it is an xbox one user.

Try this:

var XBoxLive = require('./xbox-live');
var api = new XBoxLive.Service.GamerCard();
api.profile({
    gamertag : 'khr0me'
}, function(err, data){
    console.log('return', arguments);
})

@DasCalamity
Copy link
Author

Thank you so much! I will try it out tonight! I will report back when I do!

@DasCalamity
Copy link
Author

Alright it worked! Thank you so much! Close the issue when you see this!

@khrome
Copy link
Owner

khrome commented May 2, 2017

Excellent, I'm going to leave this open as a reminder to fix the docs and will close it once complete. Glad it worked for you!

@DasCalamity
Copy link
Author

yeah and also using it, it only works with xbox 360 profiles...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants