src/IngestionEngine.js
/* Get an instance of the API client & register message listener */
Get an instance of the API client & register message listener
Get an instance of the API client & register message listener
async connect() {
        this.eh.log('Connecting to Facebook Messenger');
        let connectionPromise = new Promise((resolve) => {
            fchatAPI({
                email: this.opts.email,
                password: this.opts.password
            }, (err, api) => {
                if (err) {
                    console.error(err);
                    process.exit(1);
                }
                this.client = api;
                this.client.listenMqtt((err, msg) => this.onMessageEvent(err, msg));
                resolve();
            });
        });
        await connectionPromise;
    }
async connect ( ) { this . eh . log ( 'Connecting to Facebook Messenger' ) ; let connectionPromise = new Promise ( ( resolve ) => { fchatAPI ( { email : this . opts . email , password : this . opts . password } , ( err , api ) => { if ( err ) { console . error ( err ) ; process . exit ( 1 ) ; } this . client = api ; this . client . listenMqtt ( ( err , msg ) => this . onMessageEvent ( err , msg ) ) ; resolve ( ) ; } ) ; } ) ; await connectionPromise ; }
Get an instance of the API client & register message listener
Get an instance of the API client & register message listener