// Methods /// <summary> /// Initialize a connection to Twitch chat /// </summary> public TwitchConnection(string nick = "justinfan123", string oauth = "", ChatEdgeCluster cluster = ChatEdgeCluster.Aws, int port = -1, string[] capRequests = null, int ratelimit = 1500, bool secure = true) { _address = GetServerAddress(cluster); _pass = "******" + oauth; _nick = nick; _caps = capRequests ?? new string[2] { "twitch.tv/tags", "twitch.tv/commands" }; _secure = secure; if (port < 0) { _port = secure ? 6697 : 6667; } else { _port = port; } InitializeIrcConnection(ratelimit); }
// Static methods private static string GetServerAddress(ChatEdgeCluster cluster) { return("irc.chat.twitch.tv"); }