Skip to content

Tego Bot API Documentation v0.1.1


Tego Bot API Documentation / captureScreen

Function: captureScreen()

captureScreen(): Promise<ScreenCapture>

Defined in: index.ts:434

Capture the entire screen as a PNG image

Returns

Promise<ScreenCapture>

Promise resolving to screen capture with PNG buffer

Example

typescript
import { captureScreen } from "@tego/botjs";
import fs from "fs";

const screenshot = await captureScreen();
fs.writeFileSync('screenshot.png', screenshot.image);
console.log(`Captured ${screenshot.width}x${screenshot.height} screenshot`);

Released under the MIT License.