Added Actions & Redemptions updates via websocket messages. Updated RedemptionManager due to live changes.

This commit is contained in:
Tom
2025-01-06 14:36:54 +00:00
parent d74b132c0f
commit 77b37f04b6
14 changed files with 326 additions and 59 deletions

View File

@@ -1,5 +1,5 @@
using System.Text.Json;
using HermesSocketServer.Models;
using HermesSocketServer.Messages;
using Serilog;
using TwitchChatTTS.Chat.Commands.Limits;
using TwitchChatTTS.Chat.Groups;
@@ -24,7 +24,7 @@ namespace TwitchChatTTS.Hermes.Socket.Requests
public void Acknowledge(string requestId, string json, IDictionary<string, object>? requestData)
{
var policy = JsonSerializer.Deserialize<PolicyMessage>(json, _options);
var policy = JsonSerializer.Deserialize<Policy>(json, _options);
if (policy == null)
{
_logger.Warning($"Policy data failed: null");
@@ -40,7 +40,7 @@ namespace TwitchChatTTS.Hermes.Socket.Requests
_logger.Debug($"Policy data [policy id: {policy.Id}][path: {policy.Path}][group id: {policy.GroupId}][group name: {group.Name}]");
_policies.Set(group.Name, policy.Path, policy.Usage, TimeSpan.FromMilliseconds(policy.Span));
_logger.Information($"Policy has been updated [policy id: {policy.Id}]");
_logger.Information($"Policy has been created [policy id: {policy.Id}]");
}
}
}