index.js
/*
 * Gets called with data (request['entry'][i]) in the format of
 *
 * {
 *   id: '108276354796392',
 *   time: 1622334438323,
 *   messaging: [
 *     { ... (messaging_entry) },
 *     { ... (messaging_entry) },
 *     ...
 *   ]
 * }
 *
 * Returns promises for requests made to facebook to end
 */


Returns promises for requests made to facebook to end
Returns promises for requests made to facebook to end
function page_entry(page_entry) {
    let promises = [];
    const id = page_entry.id;
    if(Array.isArray(page_entry.messaging)) {
        for(let entry of page_entry.messaging) {
            promises.push(...messaging_entry(id, entry));
        }
    }
    return promises;
}
function page_entry ( page_entry ) { let promises = [ ] ; const id = page_entry . id ; if ( Array . isArray ( page_entry . messaging ) ) { for ( let entry of page_entry . messaging ) { promises . push ( ... messaging_entry ( id , entry ) ) ; } } return promises ; }
Gets called with data (request['entry'][i]) in the format of
 {
   id: '108276354796392',
   time: 1622334438323,
   messaging: [
     { ... (messaging_entry) },
     { ... (messaging_entry) },
     ...
   ]
 }
Gets called with data ( request [ ' entry ' ] [ i ] ) in the format of { id : ' 108276354796392 ' time : 1622334438323 messaging : [ { ... ( messaging_entry ) } { ... ( messaging_entry ) } ... ] }
// The id of a page the bot acts as (the same as in https://m.me/<page_id>)