Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const middleware = submenu.middleware(childActionCode, subOptions)
return createHandlerMiddleware(middleware, {
only: ctx => !ctx.callbackQuery || childActionCode.testIsBelow(ctx.callbackQuery.data),
hide,
hiddenFunc
})
})
const responderMiddleware = this.responders.createMiddleware({
actionCode,
setMenuFunc,
setParentMenuFunc: options.setParentMenuFunc
})
return Composer.compose([
responderMiddleware,
...functions,
...handlerFuncs
])
}
.addOnly(ctx => !ctx.callbackQuery || !ctx.callbackQuery.data || childActionCode.testIsBelow(ctx.callbackQuery.data))
if (hide) {
m.addHide(hide)
}
return m.middleware()
})
const responderMiddleware = this.responders.createMiddleware({
actionCode,
setMenuFunc,
setParentMenuFunc: options.setParentMenuFunc
})
return Composer.compose([
responderMiddleware,
...functions,
...handlerFuncs
])
}
createMiddleware(environment: ResponderEnvironment): Middleware {
const {actionCode, setMenuFunc} = environment
const menuMiddleware = Composer.action(actionCode.get(), async ctx => setMenuFunc(ctx, 'menu action'))
return Composer.compose([
menuMiddleware,
...this.responders
.map(o => createMiddlewareFromResponder(o, environment))
])
}
}