UNPKG

naruyaizumi

Version:

A WebSockets library for interacting with WhatsApp Web

28 lines (27 loc) 729 B
import { assertNodeErrorFree } from "../../WABinary/index.js"; export class USyncDisappearingModeProtocol { constructor() { this.name = "disappearing_mode"; } getQueryElement() { return { tag: "disappearing_mode", attrs: {}, }; } getUserElement() { return null; } parser(node) { if (node.tag === "disappearing_mode") { assertNodeErrorFree(node); const duration = +node?.attrs.duration; const setAt = new Date(+(node?.attrs.t || 0) * 1000); return { duration, setAt, }; } } } //# sourceMappingURL=USyncDisappearingModeProtocol.js.map