mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
19 lines
590 B
C#
19 lines
590 B
C#
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;
|
|
}
|
|
|
|
public async Task<bool> CanView(Chat chat, User user) => await _allowNsfw.GetValueAsync(chat.Id);
|
|
} |