@jikey/fcazero
Version:
Facebook Messenger bot, and is one of the most advanced next-generation Facebook Chat API (FCA)
2 lines (1 loc) • 615 B
JavaScript
import{Clients as i}from"../utils/clients.js";import l from"../utils/logger.js";class u{constructor(e,o,r){this.defaultFuncs=e;this.ctx=r}call(e,o){return new Promise(async(r,s)=>{try{const t=await this.defaultFuncs.get("https://www.facebook.com/mercury/attachments/photo",this.ctx.jar,{photo_id:e}).then(i.parseAndCheckLogin(this.ctx,this.defaultFuncs));if(t&&t.error)s(t.error);else{const p=t?.jsmods.require[0][3][0];o&&typeof o=="function"&&o(null,p),r(p)}}catch(t){l.error({err:t},"Error in resolvePhotoUrl"),o&&typeof o=="function"&&o(t instanceof Error?t:new Error(String(t))),s(t)}})}}export{u as default};