client.js
/**
         * Handles the startup of the client by using login with the given token in this.settings.
         * Waits for readyTimeout msecs to become ready, otherwise it will fail.
         * When the client becomes ready, it will start behaving like an observer.
         */
Handles the startup of the client by using login with the given token in this.settings.
Waits for readyTimeout msecs to become ready, otherwise it will fail.
When the client becomes ready, it will start behaving like an observer.
Handles the startup of the client by using login with the given token in this . settings . Waits for readyTimeout msecs to become ready otherwise it will fail . When the client becomes ready it will start behaving like an observer .
startUp() {
            return new Promise((resolve, reject) => {
                this.client.on(clientOnReadyListenerName, () => {
                    clearTimeout(this.readyTimeout);
                    this.startObservation();
                    resolve();
                });
                this.readyTimeout = setTimeout(() => {
                    this.client.off(clientOnReadyListenerName,()=>{});
                    reject('Client seems to be unable to connect to the discord server');
                }, readyTimeout);
                this.client.login(this.secret);
            });
        }
startUp ( ) { return new Promise ( ( resolve , reject ) => { this . client . on ( clientOnReadyListenerName , ( ) => { clearTimeout ( this . readyTimeout ) ; this . startObservation ( ) ; resolve ( ) ; } ) ; this . readyTimeout = setTimeout ( ( ) => { this . client . off ( clientOnReadyListenerName , ( ) => { } ) ; reject ( 'Client seems to be unable to connect to the discord server' ) ; } , readyTimeout ) ; this . client . login ( this . secret ) ; } ) ; }
Handles the startup of the client by using login with the given token in this.settings.
Handles the startup of the client by using login with the given token in this . settings .