UNPKG

@jikey/fcazero

Version:

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

2 lines (1 loc) 1.24 kB
"use strict";var h=Object.create;var u=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var c=(e,r)=>{for(var t in r)u(e,t,{get:r[t],enumerable:!0})},d=(e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of f(r))!C.call(e,o)&&o!==t&&u(e,o,{get:()=>r[o],enumerable:!(s=m(r,o))||s.enumerable});return e};var T=(e,r,t)=>(t=e!=null?h(y(e)):{},d(r||!e||!e.__esModule?u(t,"default",{value:e,enumerable:!0}):t,e)),g=e=>d(u({},"__esModule",{value:!0}),e);var A={};c(A,{default:()=>a});module.exports=g(A);var l=require("../utils/clients.js"),n=T(require("../utils/logger.js"),1);class a{constructor(r,t,s){this.defaultFuncs=r;this.ctx=s}call(r,t){return new Promise(async(s,o)=>{try{const i={variables:{version:"default"},doc_id:"24474714052117636"};return this.defaultFuncs.post("https://www.facebook.com/api/graphql/",this.ctx.jar,i).then(l.Clients.parseAndCheckLogin(this.ctx,this.defaultFuncs)).then(p=>{if(p&&p.error)throw p;t&&typeof t=="function"&&t(null,p&&p.data.messenger_thread_themes),s(p&&p.data.messenger_thread_themes)})}catch(i){n.default.error({error:i},"threadColors"),t&&typeof t=="function"&&t(i),o(i)}})}}