Moved Requests classes to here. Added some checks to requests.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using HermesSocketLibrary.Requests;
|
||||
using HermesSocketServer.Store;
|
||||
using ILogger = Serilog.ILogger;
|
||||
|
||||
@@ -7,6 +6,7 @@ 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;
|
||||
@@ -22,9 +22,9 @@ namespace HermesSocketServer.Requests
|
||||
{
|
||||
var user = _users.Get(sender);
|
||||
if (user == null)
|
||||
return new RequestResult(false, "Unable to find user data.", notifyClientsOnAccount: false);
|
||||
return RequestResult.Failed("Unable to find user data.", notifyClientsOnAccount: false);
|
||||
|
||||
return new RequestResult(true, user.DefaultVoice ?? _configuration.Tts.DefaultTtsVoice, notifyClientsOnAccount: false);
|
||||
return RequestResult.Successful(user.DefaultVoice ?? _configuration.Tts.DefaultTtsVoice, notifyClientsOnAccount: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user