Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
connect() {
this.client = new TwitchJsClient(this.options);
this.client.on('message', this.parseMessages.bind(this));
this.client.on('connected', e => {
this.emit('open', e);
});
this.client.connect().catch(err => {
this.logger.error('Problem logging into twitch:', err);
// eslint-disable-next-line no-process-exit
process.exit(0);
});
}
constructor(props: Props) {
super(props)
if (_.isNil(props.loginDetails)) {
this.state = {
error: new Error('No login details provided.'),
}
}
this.client = tmi.client({
channels: [],
connection: { reconnect: true, secure: true },
identity: props.loginDetails || undefined,
options: { clientId: process.env.REACT_APP_TWITCH_CLIENT_ID, debug: false },
})
}