Esempio n. 1
0
        private void TwitchClient_OnChatCommandReceived(object sender, OnChatCommandReceivedArgs e)
        {
            var command = e.Command.CommandText;

            if (BotCommands.Execute(e.Command.CommandText, e) > 0)
            {
                return;
            }

            if (e.Command.ChatMessage.DisplayName == "CodeRushed")
            {
                if (e.Command.CommandText == "Reset" && e.Command.ArgumentsAsString == "Fanfare")
                {
                    ResetFanfares();
                }

                if (e.Command.CommandText == "Fanfare")
                {
                    string displayName = e.Command.ChatMessage.DisplayName;
                    PlayFanfare(displayName);
                }
            }

            var scene = GetScene(command);

            if (scene != null)
            {
                ActivateSceneIfPermitted(scene, e.Command.ChatMessage.DisplayName, allViewers.GetUserLevel(e.Command.ChatMessage));
            }
            //else
            //	Whisper(e.Command.ChatMessage.Username, GetWhatMessage() + " Command not recognized: " + e.Command.CommandText);
        }
Esempio n. 2
0
        private void TwitchClient_OnChatCommandReceived(object sender, OnChatCommandReceivedArgs e)
        {
            var command = e.Command.CommandText;

            if (BotCommands.Execute(e.Command.CommandText, e) > 0)
            {
                return;
            }

            var scene = GetScene(command);

            if (scene != null)
            {
                ActivateSceneIfPermitted(scene, e.Command.ChatMessage.DisplayName, allViewers.GetUserLevel(e.Command.ChatMessage));
            }
            //else
            //	Whisper(e.Command.ChatMessage.Username, GetWhatMessage() + " Command not recognized: " + e.Command.CommandText);
        }