Sending a media group

You can send a group of the media messages (e.g. 3 photos & 2 videos)

If you want to send a media group, use MediaGroup class-method

MediaGroup class-method takes argument: media you want to send (...spread)

app.controller.ts
import { OnCommand, Controller, MediaGroup, Video, Photo } from 'nestgram';
import { AppService } from './app.service';
import * as path from 'path';

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

  @OnCommand('start')
  async start(): Promise<MediaGroup> {
    return new MediaGroup(
      new Video('path', path.resolve(__dirname, 'video.mp4')),
      new Photo('path', path.resolve(__dirname, 'photo.jpg')),
    );
  }
}

Last updated