Changed command dictionary to a command tree. Fixed various requests. OBS reconnection added if identified previously.

This commit is contained in:
Tom
2024-07-19 16:56:41 +00:00
parent e6b3819356
commit 472bfcee5d
56 changed files with 1943 additions and 1553 deletions

View File

@@ -1,5 +1,6 @@
using System.Collections.Concurrent;
using HermesSocketLibrary.Requests.Messages;
using Serilog;
namespace TwitchChatTTS.Chat.Groups
@@ -59,7 +60,10 @@ namespace TwitchChatTTS.Chat.Groups
}
public int GetPriorityFor(IEnumerable<string> groupNames) {
return groupNames.Select(g => _groups.TryGetValue(g, out var group) ? group : null).Where(g => g != null).Max(g => g.Priority);
var values = groupNames.Select(g => _groups.TryGetValue(g, out var group) ? group : null).Where(g => g != null);
if (values.Any())
return values.Max(g => g.Priority);
return 0;
}
public bool Remove(long chatterId, string groupId) {

View File

@@ -1,9 +0,0 @@
namespace TwitchChatTTS.Chat.Groups
{
public class Group
{
public string Id { get; set; }
public string Name { get; set; }
public int Priority { get; set; }
}
}

View File

@@ -1,8 +0,0 @@
namespace TwitchChatTTS.Chat.Groups
{
public class GroupChatter
{
public string GroupId { get; set; }
public long ChatterId { get; set;}
}
}

View File

@@ -1,3 +1,5 @@
using HermesSocketLibrary.Requests.Messages;
namespace TwitchChatTTS.Chat.Groups
{
public interface IChatterGroupManager

View File

@@ -1,10 +0,0 @@
namespace TwitchChatTTS.Chat.Groups.Permissions
{
public class GroupPermission
{
public string Id { get; set; }
public string GroupId { get; set; }
public string Path { get; set; }
public bool? Allow { get; set; }
}
}

View File

@@ -37,8 +37,7 @@ namespace TwitchChatTTS.Chat.Groups.Permissions
public void Clear()
{
if (_root.Children != null)
_root.Children.Clear();
_root.Clear();
}
public bool Remove(string path)
@@ -127,6 +126,11 @@ namespace TwitchChatTTS.Chat.Groups.Permissions
_children.Add(child);
}
internal void Clear() {
if (_children != null)
_children.Clear();
}
public void Remove(string name)
{
if (_children == null || !_children.Any())