danielwerg / r6api.js

🍫 Node.js wrapper around Rainbow Six Siege APIs
https://npm.im/r6api.js
MIT License
111 stars 19 forks source link

Example Code Not Working #96

Closed AidanTheJsDev closed 1 year ago

AidanTheJsDev commented 1 year ago

I tried to use the example code and I put my email and password in a .env file and I didn't get any output

danielwerg commented 1 year ago

Well, sounds like you didn't console.log anything, because you should get Daniel.Nt has played 6278 matches. output from example code.

AidanTheJsDev commented 1 year ago

How nice of you to assume the I didn't do something that I did

danielwerg commented 1 year ago

How nice of you to assume the I didn't do something that I did

All you can do is assume when you have one sentence in an issue with no way to reproduce it.

AidanTheJsDev commented 1 year ago

All you can do is assume when you have one sentence in an issue with no way to reproduce it.

Even when I console log I don't get anything it only allows me to console log something like "hi" outside of the example code

danielwerg commented 1 year ago
example.js ```js require('dotenv').config(); const R6API = require('r6api.js').default; const { UBI_EMAIL: email = '', UBI_PASSWORD: password = '' } = process.env; const r6api = new R6API({ email, password }); (async () => { const username = 'Daniel.Nt'; const platform = 'uplay'; const { 0: player } = await r6api.findByUsername(platform, username); if (!player) return 'Player not found'; const { 0: stats } = await r6api.getStats(platform, player.id); if (!stats) return 'Stats not found'; const { pvp: { general } } = stats; console.log(`${player.username} has played ${general.matches} matches.`); })(); ```

prints: Daniel.Nt has played 6278 matches.

https://nodejs.org/api/modules.html