Các bác cho em hỏi về lỗi khi xử lý file với ạ #323
Unanswered
quannt-pengu
asked this question in
Q&A
Replies: 1 comment
|
Bạn thử đoạn mã này nha: import fs from "node:fs";
import { ThreadType, Zalo } from "zca-js";
const zalo = new Zalo({ selfListen: true });
const api = await zalo.login(JSON.parse(fs.readFileSync("./credentials.json", "utf-8")));
const userId = ""; // id người nhận
api.listener.start();
api.listener.on("connected", () => {
api.sendMessage(
{
msg: "",
attachments: "./file.txt",
},
userId,
ThreadType.User // Group
);
}); |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Em đã đẩy file lên bunny storage lấy path về và gửi qua sendMessage, nhưng nó load rất lâu và chỉ gửi text chứ không gửi được file. Em đã test các định dạng file và em chỉ gửi được ảnh ạ, video, pdf,... đều bị load rất lâu và chỉ gửi text
All reactions