Giter Club home page Giter Club logo

Comments (3)

yj0524 avatar yj0524 commented on September 26, 2024

업데이트합니다. 방송이 꺼진 후 채팅은 제대로 받아와집니다. 방송이 꺼진 후 다시 켜졌을 때에만 해당되는 것으로 보입니다.

from chzzk.

yj0524 avatar yj0524 commented on September 26, 2024

방송이 시작될 때마다 chatChannelId가 변경되는 문제로 인해 발생한 오류로 보입니다.

from chzzk.

kimcore avatar kimcore commented on September 26, 2024

답변이 늦어 죄송합니다!

공식 사이트를 모방하여 일정 주기마다 chatChannelId 의 변경을 체크할 수 있도록 1.2.0 버전에 pollInterval 옵션을 추가하였습니다.
chatChannelId 가 변경된 것이 확인될 경우 자동으로 새로운 chatChannelId 로 재연결하게 됩니다.

ChzzkChat 인스턴스를 생성할 때 channelId 값을 넘겨주도록 변경되었으니 아래 코드를 참고 부탁드립니다.
channelId 값만 넘겨주면 chatChannelId, accessToken 값은 내부에서 자동으로 불러오게 되어있습니다.

const client = new ChzzkClient()

const result = await client.search.channels("녹두로로")
const channel = result.channels[0]
    
const chzzkChat = client.chat({
    channelId: channel.channelId,
    pollInterval: 30 * 1000 // channelId를 지정할 경우 자동으로 30초로 설정됨
})

from chzzk.

Related Issues (20)

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.