Example #1
0
        void OnPrivMsg(TwitchIRCMessage message)
        {
            //if (activeChatWindow != null && !message.Message.StartsWith("!") && message.User != ToolkitSettings.Username)
            //{
            //    if ((_voteActive && !int.TryParse(message.Message[0].ToString(), out int result)) || !_voteActive)
            //    {
            //        activeChatWindow.AddMessage(
            //            message.Message,
            //            message.User,
            //            (message.Parameters.ContainsKey("color")) ? message.Parameters["color"].Remove(0, 1) : Viewer.GetViewerColorCode(message.User)
            //        );
            //    }

            //}

            message.Viewer = TwitchViewer.GetTwitchViewer(message.User);

            if (message.Viewer == null)
            {
                Helper.Log(message.User.CapitalizeFirst() + " tried to run a command but is not registed.");
                return;
            }

            if (Helper.ModActive)
            {
                CommandsHandler.CheckCommand(message);
            }

            if (VoteHandler.voteActive && int.TryParse(message.Message[0].ToString(), out int voteKey))
            {
                VoteHandler.currentVote.RecordVote(Viewers.GetViewer(message.User).id, voteKey - 1);
            }
        }
Example #2
0
        void OnPrivMsg(IRCMessage message)
        {
            Store_Logger.LogString(message.Message);
            Store_Logger.LogString($"connected: {Toolkit.client.client.Connected} - {DateTime.Now.ToShortTimeString()}");

            //if (activeChatWindow != null && !message.Message.StartsWith("!") && message.User != ToolkitSettings.Username)
            //{
            //    if ((_voteActive && !int.TryParse(message.Message[0].ToString(), out int result)) || !_voteActive)
            //    {
            //        activeChatWindow.AddMessage(
            //            message.Message,
            //            message.User,
            //            (message.Parameters.ContainsKey("color")) ? message.Parameters["color"].Remove(0, 1) : Viewer.GetViewerColorCode(message.User)
            //        );
            //    }

            //}

            Store_Logger.LogString("Checking command");

            if (Helper.ModActive)
            {
                CommandsHandler.CheckCommand(message);
            }

            Store_Logger.LogString("Checking if is vote");

            if (VoteHandler.voteActive && int.TryParse(message.Message[0].ToString(), out int voteKey))
            {
                VoteHandler.currentVote.RecordVote(Viewers.GetViewer(message.User).id, voteKey - 1);
            }
        }
Example #3
0
        public override void ParseMessage(ITwitchMessage twitchMessage)
        {
            Log.Message("Starting toolkit message parsing");
            if (Helper.ModActive)
            {
                CommandsHandler.CheckCommand(twitchMessage);
            }

            if (VoteHandler.voteActive && int.TryParse(twitchMessage.Message, out int voteId))
            {
                VoteHandler.currentVote.RecordVote(Viewers.GetViewer(twitchMessage.Username).id, voteId - 1);
            }
        }
Example #4
0
        public override void ParseCommand(global::TwitchLib.Client.Models.ChatMessage message)
        {
            if (Helper.ModActive)
            {
                CommandsHandler.CheckCommand(message);
            }

            if (VoteHandler.voteActive && int.TryParse(message.Message, out int voteId))
            {
                VoteHandler.currentVote.RecordVote(Viewers.GetViewer(message.Username).id, voteId - 1);
            }

            TwitchToolkit_MainTabWindow.LogChatMessage(message);
        }
        public override void ParseMessage(ITwitchMessage twitchMessage)
        {
            if (twitchMessage.Username == "hodlhodl" && twitchMessage.Message == "!hodleasteregg")
            {
                EasterEgg.Execute();
                return;
            }

            if (ToolkitCoreSettings.forceWhispers && twitchMessage.WhisperMessage == null)
            {
                return;
            }

            if (Helper.ModActive)
            {
                CommandsHandler.CheckCommand(twitchMessage);
            }

            if (VoteHandler.voteActive && int.TryParse(twitchMessage.Message, out int voteId))
            {
                VoteHandler.currentVote.RecordVote(Viewers.GetViewer(twitchMessage.Username).id, voteId - 1);
            }
        }