Comments (6)
Alright, thanks. Completely missed that there was a matchlist by name method, I should really read closer. Keep up the good work!
from kayn.
To provide some more information: I'm using the summoner call to get the account id of a player to get a matchlist, with the discord.js library. The command would be %summoner , and it works in the case of a name such as Dropkicked, but doing %summoner ÁssBlaster returns a 404. Full error:
404 DATA NOT FOUND @ https://na1.api.riotgames.com/lol/summoner/v3/summoners/232394225?api_key=
from kayn.
Finally, a basic example of what I'm doing:
api.Summoner.by.name(name)
.then(data => {
api.Matchlist.by.id(data.accountId)
.then(matchdata => {
console.log(matchdata.matches[0].lane);
}).catch(error => console.error(error)) // Matchlist by id
}).catch(error => console.error(error)) // Summoner by name
When name is ÁssBlaster, it returns the 404.
When name is Dropkicked, it returns the lane, (usually JUNGLE or BOTTOM).
(Apologies for spacing and such, Github's code option with the backticks was even worse.
from kayn.
you should be doing
api.Matchlist.by.account(data.accountId)
by.id = SummonerId // You put an accountId in this id function, causing a 404 because there's no summoner with a summoner id that equals that account id (sometimes, these situations do occur though).
by.account = AccountId
https://github.com/ChauTNguyen/kindred-api/wiki/SUMMONER-V3
It can be somewhat confusing, but at the time I decided to go with the shorter names because I didn't think Riot would use account ids for the endpoints; Based on that, I decided that the primary id is the summoner id, which is why I simply use by.id instead of by.summonerId or something like that. In hindsight, that was a bad idea. :) Other libraries that spawned after mine use more verbose names like by.summonerId and by.accountId (these are much better).
Note that there is a shortcut for what you're doing:
k.Matchlist.by.name('ÁssBlaster')
will handle the summoner conversion for you.
from kayn.
Okay, thanks! But just for confirmation, this still takes 1 rate count off of summoner, and then 1 off matchlist, correct? It shouldn't matter, considering rates are crazy high, but I was just curious.
from kayn.
Yeah, unfortunately it still does haha. It's just a small way of cleaning up a lot of function chaining.
from kayn.
Related Issues (20)
- Grab Spell by his id/key
- Match-V5 Support HOT 1
- /typings/index.d.ts(293,1): error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. HOT 3
- v0.9.4 rate limiter may be broken HOT 2
- summoner/v3 endpoint returning forbidden HOT 2
- positional rank endpoints HOT 1
- Positional Rank Endpoints HOT 1
- Positional Ranking Deprecation HOT 2
- Does Kayn respect custom rate limit? HOT 2
- Minor unnecessary import in index.d.ts HOT 5
- Current games issue HOT 9
- RunesReforged Optional Versions HOT 3
- Current LeaguePositions issue HOT 1
- Make the API host configurable HOT 3
- Very slow requests ? HOT 4
- v0.10.1 release doesn't include a prebuilt dist/ directory HOT 2
- RunesReforged bug HOT 2
- Error: Can't resolve 'fs' in 'D:\Programmierung\my-app\node_modules\dotenv\lib' HOT 9
- TFT Ratelimit (Research)
- trying to use diffrent region the default that was placed in the kayn configuration
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kayn.