feat(zalouser): add reactions, group context, and receipt acks

This commit is contained in:
Peter Steinberger
2026-03-02 22:08:01 +00:00
parent 317075ef3d
commit f9025c3f55
15 changed files with 692 additions and 9 deletions

View File

@@ -1,5 +1,12 @@
import type { ZaloSendOptions, ZaloSendResult } from "./types.js";
import { sendZaloLink, sendZaloTextMessage, sendZaloTypingEvent } from "./zalo-js.js";
import type { ZaloEventMessage, ZaloSendOptions, ZaloSendResult } from "./types.js";
import {
sendZaloDeliveredEvent,
sendZaloLink,
sendZaloReaction,
sendZaloSeenEvent,
sendZaloTextMessage,
sendZaloTypingEvent,
} from "./zalo-js.js";
export type ZalouserSendOptions = ZaloSendOptions;
export type ZalouserSendResult = ZaloSendResult;
@@ -37,3 +44,44 @@ export async function sendTypingZalouser(
): Promise<void> {
await sendZaloTypingEvent(threadId, options);
}
export async function sendReactionZalouser(params: {
threadId: string;
msgId: string;
cliMsgId: string;
emoji: string;
remove?: boolean;
profile?: string;
isGroup?: boolean;
}): Promise<ZalouserSendResult> {
const result = await sendZaloReaction({
profile: params.profile,
threadId: params.threadId,
isGroup: params.isGroup,
msgId: params.msgId,
cliMsgId: params.cliMsgId,
emoji: params.emoji,
remove: params.remove,
});
return {
ok: result.ok,
error: result.error,
};
}
export async function sendDeliveredZalouser(params: {
profile?: string;
isGroup?: boolean;
message: ZaloEventMessage;
isSeen?: boolean;
}): Promise<void> {
await sendZaloDeliveredEvent(params);
}
export async function sendSeenZalouser(params: {
profile?: string;
isGroup?: boolean;
message: ZaloEventMessage;
}): Promise<void> {
await sendZaloSeenEvent(params);
}