Skip to content

Tego Bot API Documentation v0.2.0


Tego Bot API Documentation / imageResource

Function: imageResource()

imageResource(path): Promise<ImageResource>

Defined in: botjs/src/image-match.ts:119

Load an image from file for use as a template

Parameters

path

string

Path to the image file (PNG, JPG, BMP, etc.)

Returns

Promise<ImageResource>

Promise resolving to ImageResource

Example

typescript
import { imageResource, findOnScreen } from "@tego/botjs";

const button = await imageResource("./assets/button.png");
const match = await findOnScreen(button);

Released under the MIT License.