UNPKG

@jikey/fcazero

Version:

Facebook Messenger bot, and is one of the most advanced next-generation Facebook Chat API (FCA)

2 lines (1 loc) 617 B
import{Clients as o}from"../utils/clients.js";import i from"../utils/logger.js";class u{constructor(s,e,p){this.defaultFuncs=s;this.ctx=p}call(s,e){return new Promise((p,n)=>{try{const t={seen_timestamp:s.seen_timestamp??Date.now()};return this.defaultFuncs.post("https://www.facebook.com/ajax/mercury/mark_seen.php",this.ctx.jar,t).then(o.saveCookies(this.ctx.jar)).then(o.parseAndCheckLogin(this.ctx,this.defaultFuncs)).then(function(r){if(r&&r.error)throw r;return e&&typeof e=="function"&&e(null),p()})}catch(t){return i.error({error:t},"MarkAsSeen:"),e&&typeof e=="function"&&e(t),n(t)}})}}export{u as default};