From d6118b1facec88275d359785774aef5607787eee Mon Sep 17 00:00:00 2001 From: piloking <141794311+piloking@users.noreply.github.com> Date: Mon, 14 Oct 2024 00:39:49 +0900 Subject: [PATCH] add example --- examples/send-img.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 examples/send-img.ts diff --git a/examples/send-img.ts b/examples/send-img.ts new file mode 100644 index 0000000..a06db07 --- /dev/null +++ b/examples/send-img.ts @@ -0,0 +1,19 @@ +import { Client } from "@evex/linejs"; + +const client = new Client(); + +await client.login({ + email: "YOUR_EMAIL", + password: "YOUR_PASSWORD", + polling: [], // no polling +}); + +await client.uploadObjTalk( + "mid", + "image", // content type + await fetch("https://avatars.githubusercontent.com/u/121654029").then(r => r.blob()), // blob + "i.png" // file name +) +/* +Please make sure you set the mimeType to blob or the filename to the correct extension! +*/ \ No newline at end of file