Moved Requests classes to here. Added some checks to requests.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using HermesSocketLibrary.Requests;
|
||||
using HermesSocketServer.Services;
|
||||
using ILogger = Serilog.ILogger;
|
||||
|
||||
@@ -7,6 +6,7 @@ namespace HermesSocketServer.Requests
|
||||
public class GetTTSUsers : IRequest
|
||||
{
|
||||
public string Name => "get_tts_users";
|
||||
public string[] RequiredKeys => [];
|
||||
private ChannelManager _channels;
|
||||
private ILogger _logger;
|
||||
|
||||
@@ -19,12 +19,9 @@ namespace HermesSocketServer.Requests
|
||||
public async Task<RequestResult> Grant(string sender, IDictionary<string, object>? data)
|
||||
{
|
||||
var channel = _channels.Get(sender);
|
||||
if (channel == null)
|
||||
return new RequestResult(false, null, notifyClientsOnAccount: false);
|
||||
|
||||
var temp = channel.Chatters.Get().ToDictionary(p => p.Key, p => p.Value.VoiceId);
|
||||
var results = channel.Chatters.Get().ToDictionary(p => p.Key, p => p.Value.VoiceId);
|
||||
_logger.Information($"Fetched all chatters' selected tts voice for channel [channel: {sender}]");
|
||||
return new RequestResult(true, temp, notifyClientsOnAccount: false);
|
||||
return RequestResult.Successful(results, notifyClientsOnAccount: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user