Changed command dictionary to a command tree. Fixed various requests. OBS reconnection added if identified previously.
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace TwitchChatTTS.Chat.Groups
|
||||
{
|
||||
public class GroupChatter
|
||||
{
|
||||
public string GroupId { get; set; }
|
||||
public long ChatterId { get; set;}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
using HermesSocketLibrary.Requests.Messages;
|
||||
|
||||
namespace TwitchChatTTS.Chat.Groups
|
||||
{
|
||||
public interface IChatterGroupManager
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user