hermes-server/Requests/GetTTSWordFilters.cs

29 lines
960 B
C#
Raw Normal View History

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