Giter VIP home page Giter VIP logo

twitch-chat-client's Introduction

Deprecated repository

The code for this package is now being maintained in the twitch monorepo.

twitch-chat-client's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

happy-ferret

twitch-chat-client's Issues

Socket error

Bug Report

Code

You can either add your code here:

import React, { useState, useEffect } from "react";

import ChatClient from "twitch-chat-client";

export default ({ username, twitchClient }: any) => {
  const [gameSession, setGameSession] = useState({ user: "", message: "" });

  try {
  
  const connectStream = async () => {
    const chatClient = await ChatClient.forTwitchClient(twitchClient);

      await chatClient.connect();
      await chatClient.waitForRegistration();
      await chatClient.join(username);
  
      
    };
    useEffect(() => {
      connectStream();
    });

  } catch (error) {
    console.error(error.message)
  }


  return <div>
    USER : {gameSession.user}
    
    <br/>
    
    MSG  : {gameSession.message}
  </div>;
};

Expected behavior

I should be able to receive message from this twitch stream

Actual Behavior

I got this error:

Unhandled Rejection (TypeError): _this._socket.on is not a function

Environment

  • Version: [email protected]
  • Node version: 10.14.2
  • Browser version: 71.0.3578.98 (Official Build) (64-bit) (cohort: Stable)
  • Operating system: Windows 10

Disconnecting results in an error

Bug Report

Code

this._client = await ChatClient.forTwitchClient(twitchClient);

await this.client.connect();
await this.client.waitForRegistration();

setTimeout(() => this.client.quit(), 2000);

Expected behavior

Gracefully disconnect.

Actual Behavior

Throws a "not opened" error:

Error: not opened
    at WebSocket.send (./node_modules/universal-websocket-client/node_modules/ws/lib/WebSocket.js:360:18)
    at WebSocketConnection.sendRaw (./node_modules/ircv3/lib/Connection/WebSocketConnection.js:114:26)
    at WebSocketConnection.Connection.sendLine (./node_modules/ircv3/lib/Connection/Connection.js:85:18)
    at ChatClient.Client.send (./node_modules/ircv3/lib/Client.js:564:26)
    at ChatClient.Client.sendMessage (./node_modules/ircv3/lib/Client.js:591:14)
    at ./node_modules/ircv3/lib/Client.js:659:31
    at new Promise (<anonymous>)
    at ChatClient.<anonymous> (./node_modules/ircv3/lib/Client.js:653:39)
    at step (./node_modules/ircv3/lib/Client.js:56:23)
    at Object.next (./node_modules/ircv3/lib/Client.js:37:53)
    at ./node_modules/ircv3/lib/Client.js:31:71
    at new Promise (<anonymous>)
    at __awaiter (./node_modules/ircv3/lib/Client.js:27:12)
    at ChatClient.Client.quit (./node_modules/ircv3/lib/Client.js:650:16)

Environment

  • Version: 2.0.0-pre.4
  • Node version: v11.10.1
  • Operating system: Arch Linux

Anonymous login

Feature Request

Ability to authenticate as justinfan11111 user, so you can read chat without user auth.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.