private static void ChatClient_OnMessageOccurred(object sender, ChatMessageEventModel e) { string message = ""; foreach (ChatMessageDataModel m in e.message.message) { message += m.text; } //Plugin.Log("Got message: " + message); //OnMessageReceived(message); MixerMessageHandlers.InvokeHandler(new MixerMessage() { id = e.id.ToString(), message = message, messageType = "Message", user = new MixerUser() { id = e.user_id.ToString(), color = ColorFromRoles(e.user_roles), displayName = e.user_name, Avatar = e.user_avatar }, MessageModel = e }, ""); }
internal static void Initialize_Internal() { if (Initialized) { return; } MixerMessageHandlers.Initialize(); Task.Factory.StartNew(Loop); Initialized = true; Task.Run(() => { Thread.Sleep(1000); Connect(); }); }