Added several request messages. Added redemptions. Added life TTS voice changes. A bunch of stuffs.

This commit is contained in:
Tom
2024-08-10 19:36:32 +00:00
parent 95bc073a73
commit c771a56971
36 changed files with 552 additions and 235 deletions

View File

@@ -0,0 +1,29 @@
using HermesSocketLibrary.db;
using HermesSocketLibrary.Requests;
using ILogger = Serilog.ILogger;
namespace HermesSocketServer.Requests
{
public class GetDefaultTTSVoice : IRequest
{
public string Name => "get_default_tts_voice";
private Database _database;
private ILogger _logger;
public GetDefaultTTSVoice(Database database, ILogger logger)
{
_database = database;
_logger = logger;
}
public async Task<RequestResult> Grant(string sender, IDictionary<string, object>? data)
{
var temp = new Dictionary<string, object>() { { "user", sender } };
string sql = $"SELECT \"ttsDefaultVoice\" FROM \"User\" WHERE id = @user";
string? value = (string?)await _database.ExecuteScalar(sql, temp);
_logger.Information($"Fetched the default TTS voice for channel [channel: {sender}]");
return new RequestResult(true, value, notifyClientsOnAccount: false);
}
}
}