RiotSharp icon indicating copy to clipboard operation
RiotSharp copied to clipboard

Can't access DataDragon

Open Bruno-Marley opened this issue 3 years ago • 5 comments

I'am using this example:

var allVersion = api.DataDragon.Versions.GetAllAsync().Result;
var latestVersion = allVersion[0]; // Example of version: "10.23.1"
var champions = api.DataDragon.Champions.GetAllAsync(latestVersion).Result.Champions.Values;
foreach (var champion in champions)
{
    Console.WriteLine(champion.Name);
    Console.WriteLine(champion.Lore);
}

But it's giving me a error: Capturar

Bruno-Marley avatar Mar 05 '21 23:03 Bruno-Marley

Have you build your own nugget package? The available nugget package is not up to date and you need to build one your own. check out https://github.com/BenFradet/RiotSharp#build-your-own-latest-nuget-package for some information on that

xXLAOKOONXx avatar Mar 06 '21 00:03 xXLAOKOONXx

Ye I build it, I downloaded the zip and executed the command dotnet pack /p:Configuration=Release, then opened the folder RiotSharp > bin > Release and copied the nugget file into the root folder of my project and installed it but it still doesn't work.

Bruno-Marley avatar Mar 06 '21 23:03 Bruno-Marley

what is api defined as? because DataDragon is part of RiotApi: https://github.com/BenFradet/RiotSharp/blob/develop/RiotSharp/RiotApi.cs#L62

BenFradet avatar Mar 08 '21 09:03 BenFradet

I defined api as: var api = RiotApi.GetDevelopmentInstance("MY_API_KEY");

Bruno-Marley avatar Mar 11 '21 18:03 Bruno-Marley

Can you check if you can access 'api.StaticData' instead?
This would be an indicator for the nugget being of older version

xXLAOKOONXx avatar Mar 11 '21 19:03 xXLAOKOONXx