Changed sender parameter to channel.

This commit is contained in:
Tom
2024-12-27 23:31:36 +00:00
parent 06bfe110bb
commit 8277ea0154
27 changed files with 113 additions and 134 deletions

View File

@@ -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.");