Changed sender parameter to channel.
This commit is contained in:
@@ -17,19 +17,19 @@ namespace HermesSocketServer.Requests
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public async Task<RequestResult> Grant(string sender, IDictionary<string, object>? data)
|
||||
public async Task<RequestResult> Grant(Channel channel, IDictionary<string, object> data)
|
||||
{
|
||||
data["voice"] = data["voice"].ToString();
|
||||
data["voiceid"] = data["voiceid"].ToString();
|
||||
string voiceName = data["voice"].ToString()!;
|
||||
string voiceId = data["voiceid"].ToString()!;
|
||||
|
||||
var result = _voices.Set(data["voiceid"].ToString(), new Voice()
|
||||
var result = _voices.Set(voiceId, new Voice()
|
||||
{
|
||||
Id = data["voiceid"].ToString()!,
|
||||
Name = data["voice"].ToString()!
|
||||
Id = voiceId,
|
||||
Name = voiceName
|
||||
});
|
||||
if (result)
|
||||
{
|
||||
_logger.Information($"Updated voice's [voice id: {data["voiceid"]}] name [new name: {data["voice"]}]");
|
||||
_logger.Information($"Updated voice's [voice id: {voiceId}] name [new name: {voiceName}]");
|
||||
return RequestResult.Successful(null);
|
||||
}
|
||||
return RequestResult.Failed("Something went wrong when updating the cache.");
|
||||
|
||||
Reference in New Issue
Block a user