using HermesSocketLibrary.db; using HermesSocketLibrary.Requests; using HermesSocketLibrary.Requests.Messages; using HermesSocketServer.Store; using ILogger = Serilog.ILogger; namespace HermesSocketServer.Requests { public class GetTTSVoices : IRequest { public string Name => "get_tts_voices"; private VoiceStore _voices; private ILogger _logger; public GetTTSVoices(VoiceStore voices, ILogger logger) { _voices = voices; _logger = logger; } public async Task Grant(string sender, IDictionary? data) { IEnumerable voices = _voices.Get().Select(v => new VoiceDetails() { Id = v.Value.Id, Name = v.Value.Name }); _logger.Information($"Fetched all TTS voices for channel [channel: {sender}]"); return new RequestResult(true, voices, notifyClientsOnAccount: false); } } }