Files

33 lines
1.0 KiB
C#
Raw Permalink Normal View History

2023-07-21 18:40:24 +03:00
using Telegram.Bot.Types;
2022-11-14 00:49:56 +02:00
using Telegram.Bot.Types.Enums;
2022-02-16 17:07:30 +02:00
using West.TelegramBot.ContentStore.Model;
2023-07-21 18:40:24 +03:00
using West.TelegramBot.ContentStore.Option;
2022-02-16 17:07:30 +02:00
namespace West.TelegramBot.ContentStore.Service;
2023-07-21 18:40:24 +03:00
public class AnimBoobsService : AbstractNsfwService
2022-02-16 17:07:30 +02:00
{
private readonly HttpClient _httpClient;
public override StoreItem StoreItem { get; } = new("anim_boobs", "Сиськи.gif", 120, 40);
2022-02-16 17:07:30 +02:00
2023-07-21 18:40:24 +03:00
public AnimBoobsService(AllowNsfw allowNsfw) : base(allowNsfw)
2022-02-16 17:07:30 +02:00
{
2023-07-21 18:40:24 +03:00
_httpClient = new HttpClient
2022-02-16 17:07:30 +02:00
{
BaseAddress = new Uri("https://westdev.me/_boobs/")
};
}
2023-07-21 18:40:24 +03:00
public override async Task<RandomMedia> GetRandomMediaAsync()
2022-02-16 17:07:30 +02:00
{
var fileName = await _httpClient.GetStringAsync("index.php");
2023-01-02 23:31:05 +02:00
// https://bugs.telegram.org/c/23674 workaround
var video = await _httpClient.GetStreamAsync($"https://westdev.me/_boobs/media/{fileName}");
return new RandomMedia(new InputFile(video, fileName))
2022-02-16 17:07:30 +02:00
{
2023-01-02 23:31:05 +02:00
Type = InputMediaType.Video,
Nsfw = true
2022-02-16 17:07:30 +02:00
};
}
}