ws3-fca
Version:
A node.js package for automating Facebook Messenger bot, and is one of the most advanced next-generation Facebook Chat API (FCA) by @NethWs3Dev & @ExocoreCommunity
42 lines (35 loc) • 828 B
JavaScript
;
const utils = require('../../../utils');
// @ChoruOfficial
/**
* @param {Object} defaultFuncs
* @param {Object} api
* @param {Object} ctx
* @returns {function(): Promise<void>}
*/
module.exports = function (defaultFuncs, api, ctx) {
/**
* @returns {Promise<void>}
*/
return async function markAsReadAll() {
const form = {
folder: "inbox",
};
try {
const resData = await defaultFuncs
.post(
"https://www.facebook.com/ajax/mercury/mark_folder_as_read.php",
ctx.jar,
form
);
const parsedData = utils.parseAndCheckLogin(resData, defaultFuncs);
if (parsedData.error) {
throw parsedData;
}
return;
} catch (err) {
utils.error("markAsReadAll", err);
throw err;
}
};
};