-
Notifications
You must be signed in to change notification settings - Fork 5
Description
I just tried using the bot and noticed it doesnt work (see error message below), however im very certain I might have found the cause.
I'm just not experienced enough in programming to make this change happen on my own.
Error Message:
Configuration is valid! Ready! Checking ranks Set role by rank for { value: 'RTB#DMG', type: 'summonerName' } TypeError: Cannot read properties of undefined (reading 'includes') at Job.task (/home/container/src/events.js:96:17) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Issue:
As stated in the Riot Developer Portal in this blog post - https://developer.riotgames.com/docs/summoner-name-to-riot-id-faq - Summoner Names in the API only contain old data as of November 20, 2023.
This means players when they try to do /rank [ign] they need to use what they had before that date, if their account is older they are out of luck afaik.
Idea for a possible solution:
Im certain we could implement the Riot API like this for everything to work with the new "Name#Tag" system.
Steps:
- Use provided gameName + tagLine from discord input and use the API endpoint /riot/account/v1/accounts/by-riot-id/{gameName}/{tagLine} to retrieve the values
puuid
,gameName
andtagLine
. Use # as a seperator for formatting the input from the Discord user correctly. - Store the
puuid
in our database alongside thegameName
andtagLine
. - Get the
id
from response of this API endpoint: /lol/summoner/v4/summoners/by-puuid/{encryptedPUUID} - Finally, like now, use the API endpoint /lol/league/v4/entries/by-summoner/{encryptedSummonerId} to retrieve the
tier
+rank
values.
If I somehow can be of help or provide more details, please let me know. And thank you for making this discord bot! :)