Send contact

You can send a contact (phone number, first name, last name, user if of the user)

Send contact

To send a contact, use Contact class

Contact class take arguments:

Argument
Description
Required
1

Phone number (string)

Required

2

First name

Required

3

Last name (can be null)

Optional

4

Optional

app.controller.ts
import { Controller, Contact, MessageSend, OnCommand } from 'nestgram';
import { AppService } from './app.service';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  @OnCommand('start')
  helloMessage(): MessageSend {
    return new MessageSend(new Contact('(555) 555-1234', 'Big Smoke'))
  }
}

Last updated