Giter Site home page Giter Site logo

Comments (11)

OlegShklyarov avatar OlegShklyarov commented on May 23, 2024 1

Why are you so cool? It works. Thank you.

from tiktok-live-connector.

zerodytrash avatar zerodytrash commented on May 23, 2024

hi,

the like and social event were introduced 2 days ago. I would assume that you need to update the package.

Simply run npm i tiktok-livestream-chat-connector to install the latest version.

from tiktok-live-connector.

zerodytrash avatar zerodytrash commented on May 23, 2024

btw note that the social event also contains shares.

from tiktok-live-connector.

OlegShklyarov avatar OlegShklyarov commented on May 23, 2024

It helped, thank you! Could you please suggest, why can gifts come doubled? The gift event fires twice on every gift.

socket.on('gift', function(msg){
  |  
  | console.log("gift");
  | if (msg.giftId == "6064") {hp -= 10;gift1b.load();gift1b.play();console.log(msg.giftId)}
  | if (msg.giftId == "5487") {hp -= 50;gift2b.load();gift2b.play();}
  | if (msg.giftId == "5524") {hp -= 1000;gift3b.load();gift3b.play();}
  | if (msg.giftId == "5655") {hp += 10;gift4b.load();gift4b.play();console.log(msg.giftId)}
  | if (msg.giftId == "5177") {hp += 50;gift5b.load();gift5b.play();}
  | if (msg.giftId == "5354") {hp += 1000;gift6b.load();gift6b.play();}
  |  
  | });

They come one after another. 2 times one gift.

from tiktok-live-connector.

zerodytrash avatar zerodytrash commented on May 23, 2024

Users have the capability to send gifts in a streak. This increases the gift.repeat_count value until the user terminates the streak. During this time new gift events are triggered again and again with an increased repeat_count value.
From what I have seen, the repeat_count value is not always correct. But this seems to be a tiktok issue...

image

Take a look at the latest reader demo, which now also displays gifts: https://github.com/zerodytrash/TikTok-Chat-Reader

from tiktok-live-connector.

OlegShklyarov avatar OlegShklyarov commented on May 23, 2024

Hmmm... On our test streams even the first single gift came twice. There was no gift streaks before that user...

from tiktok-live-connector.

zerodytrash avatar zerodytrash commented on May 23, 2024

does the problem also occur on https://tiktok-chat.herokuapp.com/ ?

from tiktok-live-connector.

zerodytrash avatar zerodytrash commented on May 23, 2024

Looks correct to me.
image

from tiktok-live-connector.

OlegShklyarov avatar OlegShklyarov commented on May 23, 2024

Just tested on your Heroku app - same! Gifts come twice. Is there a way to ignore repeat_count and show any gifts only once?

Screenshot 2022-02-12 211558

Screenshot 2022-02-12 211558

from tiktok-live-connector.

zerodytrash avatar zerodytrash commented on May 23, 2024

okay, i took a closer look and found out that tiktok transmits the gift with the final repeat count at the end of a streak. This happens even if the gift was sent only once by the viewer. But that doesn't always happen. Strange. To find out if the gift is a final streak summary, you can use the repeat_end property. It is set to 0 for a running streak and 1 for a finished streak. So if only one gift was sent, sometimes you will get two gift events. One with repeat_end:0 and another with repeat_end:1.

in logic like this:

if(data.gift.repeat_end === 1) {
   // streak end, process gift
} else {
   // is still in streak phase. ignore or show/count temporarily.
}

from tiktok-live-connector.

muratyamac2021 avatar muratyamac2021 commented on May 23, 2024

Hi help me pls

from tiktok-live-connector.

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.