Moved Requests classes to here. Added some checks to requests.

This commit is contained in:
Tom
2024-10-20 20:39:13 +00:00
parent a9cdb65895
commit e3c78d96fa
23 changed files with 186 additions and 150 deletions

View File

@@ -1,5 +1,4 @@
using HermesSocketLibrary.db;
using HermesSocketLibrary.Requests;
using ILogger = Serilog.ILogger;
namespace HermesSocketServer.Requests
@@ -7,7 +6,7 @@ namespace HermesSocketServer.Requests
public class GetEnabledTTSVoices : IRequest
{
public string Name => "get_enabled_tts_voices";
public string[] RequiredKeys => [];
private readonly Database _database;
private readonly ILogger _logger;
@@ -27,7 +26,7 @@ namespace HermesSocketServer.Requests
+ "WHERE \"userId\" = @user AND state = true";
await _database.Execute(sql, temp, (r) => voices.Add(r.GetString(0)));
_logger.Information($"Fetched all enabled TTS voice for channel [channel: {sender}]");
return new RequestResult(true, voices, notifyClientsOnAccount: false);
return RequestResult.Successful(voices, notifyClientsOnAccount: false);
}
}
}