connect(...sites) { // eslint-disable-line no-unused-vars
        return new Promise((resolve, reject) => {
            this.login().then(() => {
                if (arguments.length === 0) {
                    reject("No site specified");
                }

                this.site = Array.from(arguments);

                for (const site of this.site) {
                    if (typeof site === "string") {
                        this.rooms.spawn(site);
                    } else if (Array.isArray(site)) {
                        for (let _site of site) {
                            if (typeof _site === "string") {
                                this.rooms.spawn(_site);
                            }
                        }
                    } else if (typeof site === "function") {
                        let _site = site();
                        if (_site && typeof _site === "string") {
                            this.rooms.spawn(_site);
                        }
                    }
                }

                this.rooms.connect();

                resolve();
            }).catch(reject);
        });
    }
/**
     * Tell the client to connect all rooms.
     * The arguments passed will be taken as sites to connect the bot
     * @param {String} sites The site to connect
     * @returns {Promise} Resolves when the client are connected
     */
Tell the client to connect all rooms.
The arguments passed will be taken as sites to connect the bot
@param {String} sites The site to connect
@returns {Promise} Resolves when the client are connected
Tell the client to connect all rooms . The arguments passed will be taken as sites to connect the bot @param { String } sites The site to connect @returns { Promise } Resolves when the client are connected
connect(...sites) { 
        return new Promise((resolve, reject) => {
            this.login().then(() => {
                if (arguments.length === 0) {
                    reject("No site specified");
                }
                this.site = Array.from(arguments);
                for (const site of this.site) {
                    if (typeof site === "string") {
                        this.rooms.spawn(site);
                    } else if (Array.isArray(site)) {
                        for (let _site of site) {
                            if (typeof _site === "string") {
                                this.rooms.spawn(_site);
                            }
                        }
                    } else if (typeof site === "function") {
                        let _site = site();
                        if (_site && typeof _site === "string") {
                            this.rooms.spawn(_site);
                        }
                    }
                }
                this.rooms.connect();
                resolve();
            }).catch(reject);
        });
    }
connect ( ... sites ) { return new Promise ( ( resolve , reject ) => { this . login ( ) . then ( ( ) => { if ( arguments . length === 0 ) { reject ( "No site specified" ) ; } this . site = Array . from ( arguments ) ; for ( const site of this . site ) { if ( typeof site === "string" ) { this . rooms . spawn ( site ) ; } else if ( Array . isArray ( site ) ) { for ( let _site of site ) { if ( typeof _site === "string" ) { this . rooms . spawn ( _site ) ; } } } else if ( typeof site === "function" ) { let _site = site ( ) ; if ( _site && typeof _site === "string" ) { this . rooms . spawn ( _site ) ; } } } this . rooms . connect ( ) ; resolve ( ) ; } ) . catch ( reject ) ; } ) ; }
Tell the client to connect all rooms.
Tell the client to connect all rooms .
// eslint-disable-line no-unused-vars