2024-12-27 23:31:36 +00:00
|
|
|
using HermesSocketServer.Models;
|
2024-12-27 22:28:22 +00:00
|
|
|
using ILogger = Serilog.ILogger;
|
|
|
|
|
|
|
|
namespace HermesSocketServer.Requests
|
|
|
|
{
|
|
|
|
public class DeleteTTSFilter : IRequest
|
|
|
|
{
|
|
|
|
public string Name => "delete_tts_filter";
|
|
|
|
public string[] RequiredKeys => ["id"];
|
|
|
|
private ILogger _logger;
|
|
|
|
|
2024-12-27 23:31:36 +00:00
|
|
|
public DeleteTTSFilter(ILogger logger)
|
2024-12-27 22:28:22 +00:00
|
|
|
{
|
|
|
|
_logger = logger;
|
|
|
|
}
|
|
|
|
|
2024-12-28 17:24:02 +00:00
|
|
|
public Task<RequestResult> Grant(Channel channel, IDictionary<string, object> data)
|
2024-12-27 22:28:22 +00:00
|
|
|
{
|
2024-12-27 23:31:36 +00:00
|
|
|
string filterId = data["id"].ToString()!;
|
|
|
|
channel.Filters.Remove(filterId);
|
2024-12-27 22:28:22 +00:00
|
|
|
|
2024-12-27 23:31:36 +00:00
|
|
|
_logger.Information($"Deleted a TTS filter by id [tts filter id: {filterId}]");
|
2024-12-28 17:24:02 +00:00
|
|
|
return Task.FromResult(RequestResult.Successful(null));
|
2024-12-27 22:28:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|