Aronshire / ValoCord

Use const declarations for variables that are never reassigned JS-0242
Anti-pattern
Minor
a year agoa year old
'agent' is never reassigned. Use 'const' instead.
 99
100            if (data.status === 'INGAME' && data.match) {
101                let map = this.maps.find(map => map.mapUrl === data.match.map);
102                let agent = await axios.get(`https://valorant-api.com/v1/agents/${data.match.charaterID}`).then(res => res.data.data);103                this.presence = {
104                    details: translate(this.language, "presence:ingame:details") + "[" + data.match.score.ally + " - " + data.match.score.enemy + ']',
105                    state: data.match.mode ? (translate(this.language, `presence:pregame:type:${data.match.mode.toLowerCase()}`) ?? data.match.mode) : "Custom Game",
'map' is never reassigned. Use 'const' instead.
 98            };
 99
100            if (data.status === 'INGAME' && data.match) {
101                let map = this.maps.find(map => map.mapUrl === data.match.map);102                let agent = await axios.get(`https://valorant-api.com/v1/agents/${data.match.charaterID}`).then(res => res.data.data);
103                this.presence = {
104                    details: translate(this.language, "presence:ingame:details") + "[" + data.match.score.ally + " - " + data.match.score.enemy + ']',
'map' is never reassigned. Use 'const' instead.
 87            };
 88
 89            if (data.status === 'PREGAME' && data.match) {
 90                let map = this.maps.find(map => map.mapUrl === data.match.map); 91                this.presence = {
 92                    details: translate(this.language, "presence:pregame:details"),
 93                    state: data.match.mode ? (translate(this.language, `presence:pregame:type:${data.match.mode.toLowerCase()}`) ?? data.match.mode) : "Custom Game",
'data' is never reassigned. Use 'const' instead.
 43                return;
 44            }
 45
 46            let data = await ValorantClient.getPlayerDetails(); 47            if (!data) {
 48				this.client.clearActivity()
 49                //this.clientDestroy();
'interval' is never reassigned. Use 'const' instead.
 36    async _init() {
 37        this.maps = await axios.get('https://valorant-api.com/v1/maps').then(res => res.data.data);
 38
 39        let interval = setInterval(async () => { 40            this.language = store.get("language") || "tr_TR";
 41            if (!this.isReady) {
 42                clearInterval(interval);