mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Fix GitHub API ratelimit crashing Bloxstrap (#57)
This commit is contained in:
parent
3a52aeeb67
commit
f842c56466
@ -14,10 +14,17 @@ namespace Bloxstrap.Helpers
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<T?> GetJson<T>(string url)
|
public static async Task<T?> GetJson<T>(string url)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
string json = await Program.HttpClient.GetStringAsync(url);
|
string json = await Program.HttpClient.GetStringAsync(url);
|
||||||
return JsonSerializer.Deserialize<T>(json);
|
return JsonSerializer.Deserialize<T>(json);
|
||||||
}
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return default;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static string MD5File(string filename)
|
public static string MD5File(string filename)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user