Added stores for connections. Added requests for groups, group chatters, group permissions & connections. Using TTS Voice State store.

This commit is contained in:
Tom
2025-01-17 04:32:31 +00:00
parent 422cd91db2
commit 6d955f245a
29 changed files with 759 additions and 67 deletions

View File

@@ -0,0 +1,32 @@
using HermesSocketServer.Models;
using ILogger = Serilog.ILogger;
namespace HermesSocketServer.Requests
{
public class DeleteConnection : IRequest
{
public string Name => "delete_connection";
public string[] RequiredKeys => ["id"];
private ILogger _logger;
public DeleteConnection(ILogger logger)
{
_logger = logger;
}
public Task<RequestResult> Grant(Channel channel, IDictionary<string, object> data)
{
var connectionId = data["id"].ToString()!;
var result = channel.Connections.Remove(connectionId);
if (result)
{
_logger.Information($"Deleted a connection by id [connection id: {connectionId}]");
return Task.FromResult(RequestResult.Successful(null));
}
_logger.Warning($"Connection Id does not exist [connection id: {connectionId}]");
return Task.FromResult(RequestResult.Failed("Something went wrong when updating the cache."));
}
}
}