2024-06-24 18:21:59 -04:00
|
|
|
using HermesSocketLibrary.Requests;
|
2024-10-17 23:18:40 -04:00
|
|
|
using HermesSocketServer.Store;
|
2024-06-24 18:21:59 -04:00
|
|
|
using ILogger = Serilog.ILogger;
|
|
|
|
|
|
|
|
namespace HermesSocketServer.Requests
|
|
|
|
{
|
|
|
|
public class GetTTSUsers : IRequest
|
|
|
|
{
|
|
|
|
public string Name => "get_tts_users";
|
2024-10-17 23:18:40 -04:00
|
|
|
private ChatterStore _chatters;
|
|
|
|
private ILogger _logger;
|
2024-06-24 18:21:59 -04:00
|
|
|
|
2024-10-17 23:18:40 -04:00
|
|
|
public GetTTSUsers(ChatterStore chatters, ILogger logger)
|
2024-06-24 18:21:59 -04:00
|
|
|
{
|
2024-10-17 23:18:40 -04:00
|
|
|
_chatters = chatters;
|
2024-06-24 18:21:59 -04:00
|
|
|
_logger = logger;
|
|
|
|
}
|
|
|
|
|
2024-08-10 15:36:32 -04:00
|
|
|
public async Task<RequestResult> Grant(string sender, IDictionary<string, object>? data)
|
2024-06-24 18:21:59 -04:00
|
|
|
{
|
2024-10-17 23:18:40 -04:00
|
|
|
var temp = _chatters.Get(sender);
|
2024-08-10 15:36:32 -04:00
|
|
|
_logger.Information($"Fetched all chatters' selected tts voice for channel [channel: {sender}]");
|
2024-10-17 23:18:40 -04:00
|
|
|
return new RequestResult(true, temp, notifyClientsOnAccount: false);
|
2024-06-24 18:21:59 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|