Other arguments in handler
More parameter decorators (e.g. @Text, @Answ, @Message, @Update, @Entity)
Example
import { OnText, Controller, Text, Update, Message, IMessage, IUpdate } from 'nestgram';
import { AppService } from './app.service';
@Controller()
export class AppController {
constructor(private readonly appService?: AppService) {}
@OnText()
async onText(
@Text() text: string,
@Update() update: IUpdate,
@Message() message: IMessage
): Promise<any> {
console.log(update, message);
return `I got your message! ${text}`;
}
}All supported parameter decorators
Decorator
Return value
Description
Parameters
Last updated