Handling commands
Handle when user writes a command (e.g. /start, /help, /menu)
Handle command
Get command params
Example
import { OnCommand, Controller, CommandParams } from 'nestgram';
import { AppService } from './app.service';
@Controller()
export class AppController {
constructor(private readonly appService?: AppService) {}
@OnCommand('start')
async start(@CommandParams() params: string[]): Promise<string> {
console.log(params);
return 'Hello, world!';
}
}Last updated