using HermesSocketServer.Models; using ILogger = Serilog.ILogger; namespace HermesSocketServer.Requests { public class DeleteTTSFilter : IRequest { public string Name => "delete_tts_filter"; public string[] RequiredKeys => ["id"]; private ILogger _logger; public DeleteTTSFilter(ILogger logger) { _logger = logger; } public Task Grant(Channel channel, IDictionary data) { string filterId = data["id"].ToString()!; var result = channel.Filters.Remove(filterId); if (result) { _logger.Information($"Deleted a TTS filter by id [tts filter id: {filterId}]"); return Task.FromResult(RequestResult.Successful(null)); } _logger.Warning($"Filter ID does not exist [id: {filterId}]"); return Task.FromResult(RequestResult.Failed("Filter ID does not exist.")); } } }