hermes-server/Requests/GetTTSWordFilters.cs

29 lines
960 B
C#

using HermesSocketLibrary.Requests.Messages;
using HermesSocketServer.Models;
using HermesSocketServer.Services;
using ILogger = Serilog.ILogger;
namespace HermesSocketServer.Requests
{
public class GetTTSWordFilters : IRequest
{
public string Name => "get_tts_word_filters";
public string[] RequiredKeys => [];
private ChannelManager _channels;
private ILogger _logger;
public GetTTSWordFilters(ChannelManager channels, ILogger logger)
{
_channels = channels;
_logger = logger;
}
public async Task<RequestResult> Grant(Channel channel, IDictionary<string, object> data)
{
IEnumerable<TTSWordFilter> filters = channel.Filters.Get().Values;
_logger.Information($"Fetched all word filters for channel [channel: {channel.Id}]");
return RequestResult.Successful(filters, notifyClientsOnAccount: false);
}
}
}