mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-07-03 09:35:05 +00:00
fix: remove unnecessary chat polling call
This commit is contained in:
@@ -24,7 +24,7 @@ class Livechat extends EventEmitter {
|
||||
|
||||
enqueueActionGroup(group) {
|
||||
group.forEach((action) => {
|
||||
if (!action.addChatItemAction) return; //TODO: handle different action types
|
||||
if (!action.addChatItemAction) return; //TODO: handle different action types */
|
||||
const message_content = action.addChatItemAction.item.liveChatTextMessageRenderer;
|
||||
if (!message_content) return;
|
||||
|
||||
@@ -86,10 +86,9 @@ class Livechat extends EventEmitter {
|
||||
if (continuation_contents.liveChatContinuation.continuations[0].timedContinuationData) {
|
||||
this.poll_intervals_ms = continuation_contents.liveChatContinuation.continuations[0].timedContinuationData.timeoutMs;
|
||||
} else {
|
||||
this.poll_intervals_ms = 4000;
|
||||
this.poll_intervals_ms = 3000;
|
||||
}
|
||||
|
||||
await this.poll();
|
||||
this.livechat_poller = setTimeout(() => this.poll(), this.poll_intervals_ms);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user