Sending a photo, video and other media
Sending a media by url or path
Send photo
Photo class take arguments:
Argument
Description
Required
1
2
3
4
import { OnCommand, Controller, MessageSend, 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<MessageSend> {
return new MessageSend(new Photo('path', path.resolve(__dirname, 'image.jpg')));
}
}Send other media
Set thumb
Set caption
Media caches
Last updated