2023-07-21 18:40:24 +03:00
|
|
|
using Telegram.Bot.Types;
|
|
|
|
|
using West.TelegramBot.ContentStore.Model;
|
|
|
|
|
using West.TelegramBot.ContentStore.Option;
|
|
|
|
|
|
|
|
|
|
namespace West.TelegramBot.ContentStore.Service;
|
|
|
|
|
|
|
|
|
|
public abstract class AbstractNsfwService : IRandomMediaService
|
|
|
|
|
{
|
|
|
|
|
private readonly AllowNsfw _allowNsfw;
|
|
|
|
|
public abstract StoreItem StoreItem { get; }
|
|
|
|
|
public abstract Task<RandomMedia> GetRandomMediaAsync();
|
|
|
|
|
|
|
|
|
|
protected AbstractNsfwService(AllowNsfw allowNsfw)
|
|
|
|
|
{
|
|
|
|
|
_allowNsfw = allowNsfw;
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-28 22:44:51 +03:00
|
|
|
public async Task<bool> CanView(Chat chat, User user)
|
|
|
|
|
=> await _allowNsfw.GetValueAsync(chat.Id);
|
2023-07-21 18:40:24 +03:00
|
|
|
}
|