ctx.user with a non-optional type — for flows and conversations, whose ctx is typed as the minimal RuntimeMessage. Throws UserDataError('UNAVAILABLE') when the context was not built by a Bot.
ctx.user
ctx
UserDataError('UNAVAILABLE')
flow('idioma') .ask('¿Idioma?', 'lang') .do(async (ctx, c) => { await userOf(ctx).set('lang', c.state.lang) }) Copy
flow('idioma') .ask('¿Idioma?', 'lang') .do(async (ctx, c) => { await userOf(ctx).set('lang', c.state.lang) })
ctx.userwith a non-optional type — for flows and conversations, whosectxis typed as the minimal RuntimeMessage. ThrowsUserDataError('UNAVAILABLE')when the context was not built by a Bot.