Beispiel #1
0
        private async Task <DialogTurnResult> PokemonStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            var pokemon   = stepContext.Context.Activity.Text.ToLower();
            var resultado = await _pokemon.consultarPokemon(pokemon);

            var attachments = new List <Attachment>();
            var reply       = MessageFactory.Text("No hay registro de este pokemon");
            var r           = resultado.types.Count;

            if (resultado != null)
            {
                reply = (Activity)MessageFactory.Attachment(attachments);
                reply.Attachments.Add(Cards.CreatePokemonAttachment(resultado));
            }
            await stepContext.Context.SendActivityAsync(reply, cancellationToken);

            return(await stepContext.EndDialogAsync());
        }