mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
21 lines
511 B
C#
21 lines
511 B
C#
using System.Net.Http.Json;
|
|
using West.TelegramBot.ContentStore.Model;
|
|
|
|
namespace West.TelegramBot.ContentStore.API;
|
|
|
|
public class SomeRandomApi : ISomeRandomApi
|
|
{
|
|
private readonly HttpClient _client;
|
|
|
|
public SomeRandomApi(HttpClient client)
|
|
{
|
|
_client = client;
|
|
}
|
|
|
|
public async Task<SomeRandomApiAnimalResponse> GetAnimalAsync(string animalId)
|
|
{
|
|
return (await _client.GetFromJsonAsync<SomeRandomApiAnimalResponse>(
|
|
$"animal/{animalId}"
|
|
))!;
|
|
}
|
|
} |