Spaces:
Runtime error
Runtime error
| import { | |
| Controller, | |
| Get, | |
| Query, | |
| Res, | |
| StreamableFile, | |
| UseInterceptors, | |
| } from '@nestjs/common'; | |
| import { ApiSecurity, ApiTags } from '@nestjs/swagger'; | |
| import { ApiFileAcceptHeader } from '@waha/nestjs/ApiFileAcceptHeader'; | |
| import { Response } from 'express'; | |
| import { SessionManager } from '../core/abc/manager.abc'; | |
| import { BufferResponseInterceptor } from '../nestjs/BufferResponseInterceptor'; | |
| import { SessionQuery } from '../structures/base.dto'; | |
| ('api_key') | |
| ('api') | |
| ('🖼️ Screenshot') | |
| export class ScreenshotController { | |
| constructor(private manager: SessionManager) {} | |
| ('/screenshot') | |
| (new BufferResponseInterceptor('image/jpeg')) | |
| ('image/jpeg') | |
| async screenshot( | |
| ({ passthrough: true }) res: Response, | |
| () sessionQuery: SessionQuery, | |
| ) { | |
| const whatsappService = this.manager.getSession(sessionQuery.session); | |
| return await whatsappService.getScreenshot(); | |
| } | |
| } | |