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.
Parameters
Returns
UserData
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Function exported by @botmesh/core.
function userOf(ctx): UserData;
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.
| Parameter | Type |
|---|---|
ctx | RuntimeMessage |
UserData
flow('idioma')
.ask('¿Idioma?', 'lang')
.do(async (ctx, c) => { await userOf(ctx).set('lang', c.state.lang) })