builderbot icon indicating copy to clipboard operation
builderbot copied to clipboard

[🐛]Documentation erroron addAnswer

Open marcellodpAS opened this issue 1 year ago • 0 comments

¿Que versión estas usando?

v2

¿Sobre que afecta?

Flujo de palabras (Flow)

Describe tu problema

On your documentation: https://www.builderbot.app/en/uses-cases#switch-to-another-flow

    .addAnswer(`Thanks for you answer`,async (ctx, {gotoFlow})=> {
        const userAnswer = ctx.body
        if(userAnswer === 'A'){
            return gotoFlow(flowToA)
        } 
        if(userAnswer === 'B'){
            return gotoFlow(flowToB)
        } 
        if(userAnswer === 'C'){
            return gotoFlow(flowToC)
        } 
        return gotoFlow(flowDefault)

    })

VSCode is reporting me this error:

Argument of type '(ctx: any, { gotoFlow }: { gotoFlow: any; }) => any' is not assignable to parameter of type 'string | string[]'.ts(2345)

Reproducir error

No response

Información Adicional

No response

marcellodpAS avatar Oct 19 '24 14:10 marcellodpAS