Esempio n. 1
0
        /// <summary>
        /// Returns the response for the 'no intent recognized' case.
        /// </summary>
        /// <remarks>While this specific intent handler isn't awaiting any calls, the intent handler always calls his intents asynchronously.</remarks>
        /// <returns>A list of actions for Robbie to execute, based on the current intent.</returns>
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
        public override async Task <IList <IAction> > HandleIntent()
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
        {
            var action = new NoIntentAction();

            Actions.Add(action);
            return(Actions);
        }
Esempio n. 2
0
        /// <summary>
        /// Empty execution method, used when no intent has been detected, to make sure to start listening again when no other action has been started.
        /// </summary>
        /// <param name="action">The (empty) no intent action.</param>
        /// <returns>A Task object for this method is asynchronous.</returns>
#pragma warning disable 1998
        // ReSharper disable once UnusedParameter.Local because the parameter is required for the pattern, but not relevant here
        private async Task Execute(NoIntentAction action)
#pragma warning restore 1998
        {
            ears?.StartListening();
        }