@jikey/fcazero
Version:
Facebook Messenger bot, and is one of the most advanced next-generation Facebook Chat API (FCA)
2 lines (1 loc) • 846 B
JavaScript
import o from"../utils/logger.js";import{sendRequest as p}from"./core/mqttPublish.js";class n{constructor(t,e,r){this.ctx=r}call(t,e){return new Promise(async(r,i)=>{try{if(!t.messageID)throw new Error("please pass a messageID as a first argument.");if(!t.text)throw new Error("please pass a text as a second argument.");if(this.ctx.mqttClient?.connected){const s=JSON.stringify({app_id:"772021112871879",payload:JSON.stringify({tasks:[{failure_count:null,label:"742",payload:JSON.stringify({message_id:t.messageID,text:t.text}),queue_name:"edit_message",task_id:Date.now()}],version_id:"25399313359669428"}),request_id:Date.now(),type:3}),a=await p(this.ctx.mqttClient,"/ls_req","/ls_resp",s);e&&typeof e=="function"&&e(null,a),r()}}catch(s){o.error({error:s},"Error in EditMessage"),e&&typeof e=="function"&&e(s),i(s)}})}}export{n as default};