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

@@ -1,4 +1,4 @@
using System.Text.Json;
using System.Text.RegularExpressions;
using HermesSocketLibrary.db;
using HermesSocketLibrary.Requests;
using HermesSocketLibrary.Requests.Messages;
@@ -18,18 +18,19 @@ 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)
{
data["user"] = sender;
var temp = new Dictionary<string, object>() { { "user", sender } };
IList<TTSWordFilter> filters = new List<TTSWordFilter>();
string sql = $"SELECT id, search, replace FROM \"TtsWordFilter\" WHERE \"userId\" = @user";
await _database.Execute(sql, data, (r) => filters.Add(new TTSWordFilter()
await _database.Execute(sql, temp, (r) => filters.Add(new TTSWordFilter()
{
Id = r.GetString(0),
Search = r.GetString(1),
Replace = r.GetString(2)
}));
_logger.Information($"Fetched all word filters for channel [channel: {sender}]");
return new RequestResult(true, filters, notifyClientsOnAccount: false);
}
}