How to create a custom parameter decorator? #749
Answered
by
evilsprut
totoblabla3
asked this question in
Q&A
-
export const CtxUserName = createParamDecorator((ctx: Context) => {
const username = ctx.message?.from?.username as string
|| ctx.callbackQuery?.from?.username as string
return username
}) |
Beta Was this translation helpful? Give feedback.
Answered by
evilsprut
Dec 8, 2021
Replies: 1 comment
Answer selected by
evilsprut
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See https://github.com/bukhalo/nestjs-telegraf/blob/master/sample/01-complete-app/src/common/decorators/update-type.decorator.ts