Added groups & permissions. Fixed TTS user creation. Better connection handling. Fixed 7tv reconnection.

This commit is contained in:
Tom
2024-07-16 04:48:55 +00:00
parent 9fb966474f
commit e6b3819356
45 changed files with 947 additions and 567 deletions

View File

@@ -0,0 +1,55 @@
namespace TwitchChatTTS.Chat.Emotes
{
public class EmoteDatabase : IEmoteDatabase
{
private readonly IDictionary<string, string> _emotes;
public IDictionary<string, string> Emotes { get => _emotes.AsReadOnly(); }
public EmoteDatabase()
{
_emotes = new Dictionary<string, string>();
}
public void Add(string emoteName, string emoteId)
{
if (_emotes.ContainsKey(emoteName))
_emotes[emoteName] = emoteId;
else
_emotes.Add(emoteName, emoteId);
}
public void Clear()
{
_emotes.Clear();
}
public string? Get(string emoteName)
{
return _emotes.TryGetValue(emoteName, out string? emoteId) ? emoteId : null;
}
public void Remove(string emoteName)
{
_emotes.Remove(emoteName);
}
}
public class EmoteSet
{
public string Id { get; set; }
public string Name { get; set; }
public int Flags { get; set; }
public bool Immutable { get; set; }
public bool Privileged { get; set; }
public IList<Emote> Emotes { get; set; }
public int EmoteCount { get; set; }
public int Capacity { get; set; }
}
public class Emote
{
public string Id { get; set; }
public string Name { get; set; }
public int Flags { get; set; }
}
}

View File

@@ -0,0 +1,10 @@
namespace TwitchChatTTS.Chat.Emotes
{
public interface IEmoteDatabase
{
void Add(string emoteName, string emoteId);
void Clear();
string? Get(string emoteName);
void Remove(string emoteName);
}
}