Beispiel #1
0
        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
            }, "");
        }
Beispiel #2
0
        internal static void Initialize_Internal()
        {
            if (Initialized)
            {
                return;
            }

            MixerMessageHandlers.Initialize();
            Task.Factory.StartNew(Loop);

            Initialized = true;
            Task.Run(() =>
            {
                Thread.Sleep(1000);
                Connect();
            });
        }