@jikey/fcazero
Version:
Facebook Messenger bot, and is one of the most advanced next-generation Facebook Chat API (FCA)
2 lines (1 loc) • 613 B
JavaScript
import{Axios as n}from"../utils/axios.js";import i from"../utils/logger.js";class f{constructor(r,t,p){this.defaultFuncs=r;this.ctx=p}call(r,t){return new Promise((p,u)=>{try{if(!r.url)throw new Error("Please pass a url as an argument.");const e=r.form||{},s=r.customHeaders||{};return r.notAPI?n.post(r.url,this.ctx.jar,e,s).then(function(o){return t&&typeof t=="function"&&t(null,o),p(o)}):this.defaultFuncs.post(r.url,this.ctx.jar,e,s).then(function(o){return t&&typeof t=="function"&&t(null,o),p(o)})}catch(e){return i.error({error:e},"HttpPost:"),t&&typeof t=="function"&&t(e),u(e)}})}}export{f as default};