/// <summary> /// Handles the skill intent as an asynchronous operation. /// </summary> /// <param name="intent">The intent to handle.</param> /// <param name="session">The Alexa session.</param> /// <returns> /// A <see cref="Task{TResult}"/> representing the asynchronous operation /// which returns the <see cref="ResponseBody"/> to return from the skill. /// </returns> public async Task <SkillResponse> OnIntentAsync(Intent intent, Session session) { TrackEvent(intent.Name, session, intent); IIntent userIntent = IntentFactory.Create(intent); return(await userIntent.RespondAsync(intent, session)); }
/// <summary> /// Initializes a new instance of the <see cref="AlexaSkill"/> class. /// </summary> /// <param name="intentFactory">The factory to use for the skill intents.</param> /// <param name="telemetry">The telemetry client to use.</param> /// <param name="logger">The logger to use.</param> public AlexaSkill( IntentFactory intentFactory, TelemetryClient telemetry, ILogger <AlexaSkill> logger) { IntentFactory = intentFactory; Logger = logger; Telemetry = telemetry; }