redai-automation-web-sdk
Version:
TypeScript SDK for RedAI Automation Web API - Zalo Personal automation, messaging, advanced sticker search, and bulk operations. 100% compatible with automation-web backend. v1.8.0: Added SessionProxyService for managing proxy assignments to sessions with
39 lines • 1.07 kB
JavaScript
;
/**
* Message Types
* 100% khớp với zalo-personal-sdk/src/models/Message.ts
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.GroupMessage = exports.UserMessage = void 0;
const enums_1 = require("./enums");
/**
* User Message Class
*/
class UserMessage {
constructor(uid, data) {
this.type = enums_1.ThreadType.USER;
this.data = data;
this.threadId = data.uidFrom === "0" ? data.idTo : data.uidFrom;
this.isSelf = data.uidFrom === "0";
if (data.idTo === "0")
data.idTo = uid;
if (data.uidFrom === "0")
data.uidFrom = uid;
}
}
exports.UserMessage = UserMessage;
/**
* Group Message Class
*/
class GroupMessage {
constructor(uid, data) {
this.type = enums_1.ThreadType.GROUP;
this.data = data;
this.threadId = data.idTo;
this.isSelf = data.uidFrom === "0";
if (data.uidFrom === "0")
data.uidFrom = uid;
}
}
exports.GroupMessage = GroupMessage;
//# sourceMappingURL=message.js.map