2020-10-04 15:30:04 +00:00
|
|
|
import { RiotRateLimiter } from '@fightmegg/riot-rate-limiter'
|
|
|
|
|
import { JaxConfig } from '../../JaxConfig'
|
|
|
|
|
import JaxRequest from '../JaxRequest'
|
|
|
|
|
|
|
|
|
|
export default class SpectatorEndpoint {
|
|
|
|
|
private config: JaxConfig
|
|
|
|
|
private limiter: RiotRateLimiter
|
|
|
|
|
|
|
|
|
|
constructor (config: JaxConfig, limiter: RiotRateLimiter) {
|
|
|
|
|
this.config = config
|
|
|
|
|
this.limiter = limiter
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-04 20:05:16 +00:00
|
|
|
public summonerID (summonerID: string, region: string) {
|
2020-10-04 15:30:04 +00:00
|
|
|
return new JaxRequest(
|
|
|
|
|
region,
|
|
|
|
|
this.config,
|
|
|
|
|
`spectator/v4/active-games/by-summoner/${summonerID}`,
|
|
|
|
|
this.limiter,
|
|
|
|
|
0
|
|
|
|
|
).execute()
|
|
|
|
|
}
|
|
|
|
|
}
|