hermes-server/Requests/GetTTSUsers.cs

24 lines
793 B
C#
Raw Normal View History

2024-12-27 23:31:36 +00:00
using HermesSocketServer.Models;
using ILogger = Serilog.ILogger;
namespace HermesSocketServer.Requests
{
public class GetTTSUsers : IRequest
{
public string Name => "get_tts_users";
public string[] RequiredKeys => [];
private ILogger _logger;
2024-12-27 23:31:36 +00:00
public GetTTSUsers(ILogger logger)
{
_logger = logger;
}
2024-12-27 23:31:36 +00:00
public async Task<RequestResult> Grant(Channel channel, IDictionary<string, object> data)
{
var results = channel.Chatters.Get().ToDictionary(p => p.Key, p => p.Value.VoiceId);
2024-12-27 23:31:36 +00:00
_logger.Information($"Fetched all chatters' selected tts voice for channel [channel: {channel.Id}]");
return RequestResult.Successful(results, notifyClientsOnAccount: false);
}
}
}