Changed sender parameter to channel.
This commit is contained in:
@@ -19,20 +19,19 @@ namespace HermesSocketServer.Requests
|
||||
_random = new Random();
|
||||
}
|
||||
|
||||
|
||||
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()!;
|
||||
string voice = data["voice"].ToString()!;
|
||||
string id = RandomString(25);
|
||||
|
||||
var result = _voices.Set(id, new Voice()
|
||||
{
|
||||
Id = id,
|
||||
Name = data["voice"].ToString()
|
||||
Name = voice
|
||||
});
|
||||
|
||||
if (result) {
|
||||
_logger.Information($"Added a new voice [voice: {data["voice"]}][voice id: {id}]");
|
||||
_logger.Information($"Added a new voice [voice: {voice}][voice id: {id}]");
|
||||
return RequestResult.Successful(id);
|
||||
}
|
||||
return RequestResult.Failed("Something went wrong when updating the cache.");
|
||||
|
||||
Reference in New Issue
Block a user