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

@@ -17,14 +17,20 @@ namespace HermesSocketServer.Requests
_logger = logger;
}
public async Task<RequestResult> Grant(string sender, IDictionary<string, object> data)
public async Task<RequestResult> Grant(string sender, IDictionary<string, object>? data)
{
if (data == null)
{
_logger.Warning("Data received from request is null. Ignoring it.");
return new RequestResult(false, null);
}
if (data["voice"] is JsonElement v)
data["voice"] = v.ToString();
string sql = "DELETE FROM \"TtsVoice\" WHERE id = @voice";
var result = await _database.Execute(sql, data);
_logger.Information($"Deleted a voice by id: {data["voice"]}");
_logger.Information($"Deleted a voice by id [voice id: {data["voice"]}]");
return new RequestResult(result == 1, null);
}
}