Esempio n. 1
0
        public TwitchService(string username, string password, string channel, string Id, TwitchHub hub_)
        {
            hub      = hub_;
            Username = username;
            Password = password;
            Channel  = channel;
            ClientId = Id;

            ConnCred = new ConnectionCredentials(Username, Password);
        }
            private void Client_OnMessageReceived(object sender, OnMessageReceivedArgs e)
            {
                // Register the user info always and before doing anything else, so it is appropriately up to date in
                // case a bot command is being issued
                TwitchHub.AddUser(e.ChatMessage.DisplayName, e.ChatMessage.ColorHex);

                string msg = e.ChatMessage.Message;

                if (msg.StartsWith("!"))
                {
                    HandleChatBoxMessage(msg.TrimStart('!'), e.ChatMessage);
                }
            }