コード例 #1
0
        public void BotResultToVLCCommand(IBotResult botResult)
        {
            string prefix     = "vlc:";
            string vlcRawText = String.Empty;

            if (botResult.Text.Length > prefix.Length && botResult.Text.StartsWith(prefix))
            {
                vlcRawText = botResult.Text.Substring(prefix.Length);
            }
            else
            {
                return;
            }

            vlcRawText = vlcRawText.Trim();

            VLCCommand vlcCommand;

            switch (vlcRawText)
            {
            case "step volume up":
            case "step volumeup":
                vlcCommand = new VLCCommand(VLCCommandType.StepVolumeUp);
                break;

            case "step volume down":
            case "step volumedown":
                vlcCommand = new VLCCommand(VLCCommandType.StepVolumeDown);
                break;

            case "launch and connect":
            case "launchandconnect":
                vlcCommand = new VLCCommand(VLCCommandType.LaunchAndConnect);
                break;

            case "fast forward":
            case "fastforward":
                vlcCommand = new VLCCommand(VLCCommandType.FastForward);
                break;

            case "previous":
            case "prev":
                vlcCommand = new VLCCommand(VLCCommandType.Previous);
                break;

            default:
                vlcCommand = new VLCCommand(vlcRawText);
                Console.WriteLine("Bot result as RawText");
                break;
            }

            hub.Publish <VLCCommand>(vlcCommand);
        }
コード例 #2
0
 private void ProcessBotResult(IBotResult botResult)
 {
     Hub.Publish <IBotResult>(new BotResult("Dummy - Message reached ICANCOMPREHEND", botResult.UserResponse));
 }
コード例 #3
0
 private void AddBotResult(IBotResult response)
 {
     helper.AddBotMessage(response.Text);
 }
コード例 #4
0
 private void ProcessBotResult(IBotResult botResult)
 {
     helper.PublishMessageToSubscribers(MessageType.BotResult, botResult.Text);
 }
コード例 #5
0
 static void PrintBotResult(IBotResult botResult)
 {
     Console.WriteLine("BotResult: " + botResult.Text);
 }