Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(rules: Array, customOpts?: IYveBotOptions) {
const DEFAULT_OPTS: IYveBotOptions = {
enableWaitForSleep: true,
timePerChar: 40,
};
this.sessionId = 'session';
this.options = { ...DEFAULT_OPTS, ...customOpts };
this.rules = sanitizeBotRules(rules);
this.handlers = {};
this.store = new Store(this);
this.controller = new Controller(this);
this.queue = new PQueue(1);
if (this.options.context) {
this.store.set('context', this.options.context);
}
this.on('error', err => {
/* istanbul ignore next */
throw err;
});
}