using HermesSocketServer.Store; using ILogger = Serilog.ILogger; namespace HermesSocketServer.Requests { public class GetDefaultTTSVoice : IRequest { public string Name => "get_default_tts_voice"; public string[] RequiredKeys => []; private readonly UserStore _users; private readonly ServerConfiguration _configuration; private readonly ILogger _logger; public GetDefaultTTSVoice(UserStore users, ServerConfiguration configuration, ILogger logger) { _users = users; _configuration = configuration; _logger = logger; } public async Task Grant(string sender, IDictionary? data) { var user = _users.Get(sender); if (user == null) return RequestResult.Failed("Unable to find user data.", notifyClientsOnAccount: false); return RequestResult.Successful(user.DefaultVoice ?? _configuration.Tts.DefaultTtsVoice, notifyClientsOnAccount: false); } } }