zerodytrash / TikTok-Live-Connector

Node.js library to receive live stream events (comments, gifts, etc.) in realtime from TikTok LIVE.
https://discord.gg/2c6kX6g3Pa
MIT License
1.32k stars 277 forks source link

[BUG] 'sendMessage' not working properly #153

Open nullptrmachine opened 11 months ago

nullptrmachine commented 11 months ago

Error: Failed to send chat message. Request failed with status code 403

let tiktokLiveConnection = new WebcastPushConnection(targetUsername, {
    processInitialData: false,
    sessionId: sessionID
});
tiktokLiveConnection.on('chat', data => {
  comment = data.comment;

  log(chalk.bold(`${data.uniqueId}`, chalk.white(': '), chalk.green(`${comment}`)));

  // testing
  setTimeout(() => {
    tiktokLiveConnection.sendMessage(getRandomElement(messages)).catch(err => log(error(err)));
  }, 3000);
});

However, there was cases where it did actually work and I got a lot of messages sent in sequence... There must be issue somewhere.

When I think about it, maybe the execution time needs to be synced or more cookie variables?

samarmar0vitch commented 11 months ago

the same issue

Gaboros commented 11 months ago

same for me

jiangjiangdev commented 8 months ago

I got the same issue

williambastard commented 6 months ago

same here

DEMORALIZ3D commented 2 days ago

Same here. I noticed this isn't working but there is a new chat bot feature on tikfinity. Any chance there is a work around? Needing to log in to tiktok account/session id/certficiate etc?

It would be good to create a bot using this package opposed to the alternative which is using node to mimic typing in to the chatbox