How to use the twitch-js.client function in twitch-js

To help you get started, we’ve selected a few twitch-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github destinygg / chat-bot / lib / services / twitch-chat.js View on Github external
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);
    });
  }
github HiDeoo / YaTA / src / containers / Chat.tsx View on Github external
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 },
    })
  }

twitch-js

Javascript library for the Twitch Messaging Interface.

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis