IRC parsing, tokenization, and state handling in C#
1using System.Collections.Generic;
2using System.Linq;
3
4namespace IRCRobots
5{
6 public class MessageTag
7 {
8 public MessageTag()
9 {
10 Tags = new[] {Name, DraftName};
11 }
12
13 public string Name { get; set; }
14 public string DraftName { get; set; }
15 public IEnumerable<string> Tags { get; }
16
17 public string? Available(IEnumerable<string> tags)
18 {
19 return Tags.FirstOrDefault(tag => tag != null && tags.Contains(tag));
20 }
21
22 public string? Get(Dictionary<string, string> tags)
23 {
24 return "";
25 }
26 }
27}