public Chatter(IRCPrivmsg Privmsg, IRCTags Tags) { login = Privmsg.login; channel = Privmsg.channel; message = Privmsg.message; tags = Tags; }
private void HandlePRIVMSG(string ircString, string tagString) { // Parse PRIVMSG IRCPrivmsg privmsg = new IRCPrivmsg( ParseHelper.ParseLoginName(ircString), ParseHelper.ParseChannel(ircString), ParseHelper.ParseMessage(ircString) ); // Parse Tags IRCTags tags = ParseHelper.ParseTags(tagString, settings.parseBadges, settings.parseTwitchEmotes); // Sort emotes to match emote order with the chat message (compares emote indexes) if (tags.emotes.Count > 0) { tags.emotes.Sort((a, b) => 1 * a.indexes[0].startIndex.CompareTo(b.indexes[0].startIndex)); } // Send chatter object to listeners // Invoke in main thread MainThread.Instance.Enqueue(() => newChatMessageEvent.Invoke(new Chatter(privmsg, tags))); }