youtubei.js / YT / LiveChat
Class: LiveChat
Extends
Constructors
new LiveChat()
new LiveChat(
video_info
):LiveChat
Parameters
• video_info: VideoInfo
Returns
Overrides
Defined in
src/parser/youtube/LiveChat.ts:71
Properties
initial_info?
optional
initial_info:LiveChatContinuation
Defined in
src/parser/youtube/LiveChat.ts:65
is_replay
is_replay:
boolean
=false
Defined in
src/parser/youtube/LiveChat.ts:69
metadata?
optional
metadata:LiveMetadata
Defined in
src/parser/youtube/LiveChat.ts:66
running
running:
boolean
=false
Defined in
src/parser/youtube/LiveChat.ts:68
smoothed_queue
smoothed_queue:
SmoothedQueue
Defined in
src/parser/youtube/LiveChat.ts:56
Methods
addEventListener()
addEventListener(
type
,callback
,options
?):void
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
Parameters
• type: string
• callback: null
| EventListenerOrEventListenerObject
• options?: boolean
| AddEventListenerOptions
Returns
void
Inherited from
Defined in
node_modules/.deno/[email protected]/node_modules/typescript/lib/lib.dom.d.ts:8303
applyFilter()
applyFilter(
filter
):void
Applies given filter to the live chat.
Parameters
• filter: "TOP_CHAT"
| "LIVE_CHAT"
Filter to apply.
Returns
void
Defined in
src/parser/youtube/LiveChat.ts:285
dispatchEvent()
dispatchEvent(
event
):boolean
Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
Parameters
• event: Event
Returns
boolean
Inherited from
Defined in
node_modules/.deno/[email protected]/node_modules/typescript/lib/lib.dom.d.ts:8309
emit()
emit(
type
, ...args
):void
Parameters
• type: string
• ...args: any
[]
Returns
void
Inherited from
Defined in
src/utils/EventEmitterLike.ts:10
getItemMenu()
getItemMenu(
item
):Promise
<ItemMenu
>
Retrieves given chat item's menu.
Parameters
• item: ChatItemWithMenu
Returns
Promise
<ItemMenu
>
Defined in
src/parser/youtube/LiveChat.ts:303
off()
off(
type
,listener
):void
Parameters
• type: string
• listener
Returns
void
Inherited from
Defined in
src/utils/EventEmitterLike.ts:40
on()
on(type, listener)
on(
type
,listener
):void
Parameters
• type: "start"
• listener
Returns
void
Overrides
Defined in
src/parser/youtube/LiveChat.ts:106
on(type, listener)
on(
type
,listener
):void
Parameters
• type: "chat-update"
• listener
Returns
void
Overrides
EventEmitter.on
Defined in
src/parser/youtube/LiveChat.ts:107
on(type, listener)
on(
type
,listener
):void
Parameters
• type: "metadata-update"
• listener
Returns
void
Overrides
EventEmitter.on
Defined in
src/parser/youtube/LiveChat.ts:108
on(type, listener)
on(
type
,listener
):void
Parameters
• type: "error"
• listener
Returns
void
Overrides
EventEmitter.on
Defined in
src/parser/youtube/LiveChat.ts:109
on(type, listener)
on(
type
,listener
):void
Parameters
• type: "end"
• listener
Returns
void
Overrides
EventEmitter.on
Defined in
src/parser/youtube/LiveChat.ts:110
once()
once(type, listener)
once(
type
,listener
):void
Parameters
• type: "start"
• listener
Returns
void
Overrides
Defined in
src/parser/youtube/LiveChat.ts:115
once(type, listener)
once(
type
,listener
):void
Parameters
• type: "chat-update"
• listener
Returns
void
Overrides
EventEmitter.once
Defined in
src/parser/youtube/LiveChat.ts:116
once(type, listener)
once(
type
,listener
):void
Parameters
• type: "metadata-update"
• listener
Returns
void
Overrides
EventEmitter.once
Defined in
src/parser/youtube/LiveChat.ts:117
once(type, listener)
once(
type
,listener
):void
Parameters
• type: "error"
• listener
Returns
void
Overrides
EventEmitter.once
Defined in
src/parser/youtube/LiveChat.ts:118
once(type, listener)
once(
type
,listener
):void
Parameters
• type: "end"
• listener
Returns
void
Overrides
EventEmitter.once
Defined in
src/parser/youtube/LiveChat.ts:119
removeEventListener()
removeEventListener(
type
,callback
,options
?):void
Removes the event listener in target's event listener list with the same type, callback, and options.
Parameters
• type: string
• callback: null
| EventListenerOrEventListenerObject
• options?: boolean
| EventListenerOptions
Returns
void
Inherited from
EventEmitter
.removeEventListener
Defined in
node_modules/.deno/[email protected]/node_modules/typescript/lib/lib.dom.d.ts:8315
selectButton()
selectButton(
button
):Promise
<IParsedResponse
>
Equivalent to "clicking" a button.
Parameters
• button: Button
Returns
Promise
<IParsedResponse
>
Defined in
src/parser/youtube/LiveChat.ts:318
sendMessage()
sendMessage(
text
):Promise
<ObservedArray
<AddChatItemAction
>>
Sends a message.
Parameters
• text: string
Text to send.
Returns
Promise
<ObservedArray
<AddChatItemAction
>>
Defined in
src/parser/youtube/LiveChat.ts:253
start()
start():
void
Returns
void
Defined in
src/parser/youtube/LiveChat.ts:124
stop()
stop():
void
Returns
void