YouTubePHP Documentation

LiveChatMessageSnippet extends Part
in package

This file is generated from spec/discovery.json (YouTube Data API v3, revision 20260924) by tools/generate.php. Do not edit it by hand - run `composer spec:build` instead.

Tags
since
1.0.0

Table of Contents

Constants

TYPE_CHAT_ENDED_EVENT  : mixed = 'chatEndedEvent'
A `type` of `chatEndedEvent`.
TYPE_FAN_FUNDING_EVENT  : mixed = 'fanFundingEvent'
A `type` of `fanFundingEvent`.
TYPE_GIFT_EVENT  : mixed = 'giftEvent'
A virtual gift sent by a viewer to support a creator.
TYPE_GIFT_MEMBERSHIP_RECEIVED_EVENT  : mixed = 'giftMembershipReceivedEvent'
A `type` of `giftMembershipReceivedEvent`.
TYPE_INVALID_TYPE  : mixed = 'invalidType'
A `type` of `invalidType`.
TYPE_MEMBER_MILESTONE_CHAT_EVENT  : mixed = 'memberMilestoneChatEvent'
A `type` of `memberMilestoneChatEvent`.
TYPE_MEMBERSHIP_GIFTING_EVENT  : mixed = 'membershipGiftingEvent'
A `type` of `membershipGiftingEvent`.
TYPE_MESSAGE_DELETED_EVENT  : mixed = 'messageDeletedEvent'
A `type` of `messageDeletedEvent`.
TYPE_MESSAGE_RETRACTED_EVENT  : mixed = 'messageRetractedEvent'
A `type` of `messageRetractedEvent`.
TYPE_NEW_SPONSOR_EVENT  : mixed = 'newSponsorEvent'
A `type` of `newSponsorEvent`.
TYPE_POLL_EVENT  : mixed = 'pollEvent'
A `type` of `pollEvent`.
TYPE_SPONSOR_ONLY_MODE_ENDED_EVENT  : mixed = 'sponsorOnlyModeEndedEvent'
A `type` of `sponsorOnlyModeEndedEvent`.
TYPE_SPONSOR_ONLY_MODE_STARTED_EVENT  : mixed = 'sponsorOnlyModeStartedEvent'
A `type` of `sponsorOnlyModeStartedEvent`.
TYPE_SUPER_CHAT_EVENT  : mixed = 'superChatEvent'
A `type` of `superChatEvent`.
TYPE_SUPER_STICKER_EVENT  : mixed = 'superStickerEvent'
A `type` of `superStickerEvent`.
TYPE_TEXT_MESSAGE_EVENT  : mixed = 'textMessageEvent'
A `type` of `textMessageEvent`.
TYPE_TOMBSTONE  : mixed = 'tombstone'
A `type` of `tombstone`.
TYPE_USER_BANNED_EVENT  : mixed = 'userBannedEvent'
A `type` of `userBannedEvent`.

Properties

$authorChannelId  : string|null
$displayMessage  : string|null
$fanFundingEventDetails  : LiveChatFanFundingEventDetails|null
$giftDetails  : LiveChatGiftDetails|null
$giftMembershipReceivedDetails  : LiveChatGiftMembershipReceivedDetails|null
$hasDisplayContent  : bool|null
$liveChatId  : string|null
$memberMilestoneChatDetails  : LiveChatMemberMilestoneChatDetails|null
$membershipGiftingDetails  : LiveChatMembershipGiftingDetails|null
$messageDeletedDetails  : LiveChatMessageDeletedDetails|null
$messageRetractedDetails  : LiveChatMessageRetractedDetails|null
$newSponsorDetails  : LiveChatNewSponsorDetails|null
$pollDetails  : LiveChatPollDetails|null
$publishedAt  : CarbonImmutable|null
$superChatDetails  : LiveChatSuperChatDetails|null
$superStickerDetails  : LiveChatSuperStickerDetails|null
$textMessageDetails  : LiveChatTextMessageDetails|null
$type  : string|null
$userBannedDetails  : LiveChatUserBannedMessageDetails|null
$casts  : array<string, string>
Attribute name => type token (`"LiveChatMessageSnippet"`, `"Array of Thumbnail"`, `"Map of VideoLocalization"`), used to hydrate nested objects into parts.
$dates  : array<int, string>
Attribute names holding RFC 3339 timestamps, read back as {@see CarbonImmutable}. They are stored and serialised as the strings YouTube sent.
$youtube  : ?YouTube

Methods

__construct()  : mixed
__debugInfo()  : array<string, mixed>
__get()  : mixed
__isset()  : bool
__set()  : void
__toString()  : string
__unset()  : void
attributeExists()  : bool
fill()  : void
getAttribute()  : mixed
getCasts()  : array<string, string>
getDates()  : array<int, string>
getRawAttribute()  : mixed
Reads straight from the attribute bag, skipping the `get{Key}Attribute` hook.
getRawAttributes()  : array<string, mixed>
getYouTube()  : YouTube
The client this part came from.
jsonSerialize()  : array<string, mixed>
The payload this part would be sent back to YouTube as: nested parts and collections flattened, timestamps as RFC 3339 strings.
offsetExists()  : bool
offsetGet()  : mixed
offsetSet()  : void
offsetUnset()  : void
setAttribute()  : void
factory()  : Factory
Builds another part from the same client - for nested objects.
setRawAttribute()  : void
Writes straight to the attribute bag, skipping the `set{Key}Attribute` hook and any cast. For use *inside* a mutator, which would otherwise have no way to store its shaped value without recursing through {@see setAttribute()}.

Constants

TYPE_CHAT_ENDED_EVENT

A `type` of `chatEndedEvent`.

public mixed TYPE_CHAT_ENDED_EVENT = 'chatEndedEvent'

TYPE_FAN_FUNDING_EVENT

A `type` of `fanFundingEvent`.

public mixed TYPE_FAN_FUNDING_EVENT = 'fanFundingEvent'

TYPE_GIFT_EVENT

A virtual gift sent by a viewer to support a creator.

public mixed TYPE_GIFT_EVENT = 'giftEvent'

TYPE_GIFT_MEMBERSHIP_RECEIVED_EVENT

A `type` of `giftMembershipReceivedEvent`.

public mixed TYPE_GIFT_MEMBERSHIP_RECEIVED_EVENT = 'giftMembershipReceivedEvent'

TYPE_MEMBER_MILESTONE_CHAT_EVENT

A `type` of `memberMilestoneChatEvent`.

public mixed TYPE_MEMBER_MILESTONE_CHAT_EVENT = 'memberMilestoneChatEvent'

TYPE_MEMBERSHIP_GIFTING_EVENT

A `type` of `membershipGiftingEvent`.

public mixed TYPE_MEMBERSHIP_GIFTING_EVENT = 'membershipGiftingEvent'

TYPE_MESSAGE_DELETED_EVENT

A `type` of `messageDeletedEvent`.

public mixed TYPE_MESSAGE_DELETED_EVENT = 'messageDeletedEvent'

TYPE_MESSAGE_RETRACTED_EVENT

A `type` of `messageRetractedEvent`.

public mixed TYPE_MESSAGE_RETRACTED_EVENT = 'messageRetractedEvent'

TYPE_NEW_SPONSOR_EVENT

A `type` of `newSponsorEvent`.

public mixed TYPE_NEW_SPONSOR_EVENT = 'newSponsorEvent'

TYPE_SPONSOR_ONLY_MODE_ENDED_EVENT

A `type` of `sponsorOnlyModeEndedEvent`.

public mixed TYPE_SPONSOR_ONLY_MODE_ENDED_EVENT = 'sponsorOnlyModeEndedEvent'

TYPE_SPONSOR_ONLY_MODE_STARTED_EVENT

A `type` of `sponsorOnlyModeStartedEvent`.

public mixed TYPE_SPONSOR_ONLY_MODE_STARTED_EVENT = 'sponsorOnlyModeStartedEvent'

TYPE_SUPER_CHAT_EVENT

A `type` of `superChatEvent`.

public mixed TYPE_SUPER_CHAT_EVENT = 'superChatEvent'

TYPE_SUPER_STICKER_EVENT

A `type` of `superStickerEvent`.

public mixed TYPE_SUPER_STICKER_EVENT = 'superStickerEvent'

TYPE_TEXT_MESSAGE_EVENT

A `type` of `textMessageEvent`.

public mixed TYPE_TEXT_MESSAGE_EVENT = 'textMessageEvent'

TYPE_USER_BANNED_EVENT

A `type` of `userBannedEvent`.

public mixed TYPE_USER_BANNED_EVENT = 'userBannedEvent'

Properties

$authorChannelId

public string|null $authorChannelId

The ID of the user that authored this message, this field is not always filled. textMessageEvent - the user that wrote the message fanFundingEvent - the user that funded the broadcast newSponsorEvent - the user that just became a sponsor memberMilestoneChatEvent - the member that sent the message membershipGiftingEvent - the user that made the purchase giftMembershipReceivedEvent - the user that received the gift membership messageDeletedEvent - the moderator that took the action. Unused. messageRetractedEvent - the author that retracted their message. Unused. userBannedEvent - the moderator that took the action superChatEvent - the user that made the purchase superStickerEvent - the user that made the purchase pollEvent - the user that created the poll

$displayMessage

public string|null $displayMessage

Contains a string that can be displayed to the user. If this field is not present the message is silent, at the moment only messages of type TOMBSTONE and CHAT_ENDED_EVENT are silent.

$hasDisplayContent

public bool|null $hasDisplayContent

Whether the message has display content that should be displayed to users.

$newSponsorDetails

public LiveChatNewSponsorDetails|null $newSponsorDetails

Details about the New Member Announcement event, this is only set if the type is 'newSponsorEvent'. Please note that "member" is the new term for "sponsor".

$publishedAt

public CarbonImmutable|null $publishedAt

The date and time when the message was orignally published.

$type

public string|null $type

The type of message, this will always be present, it determines the contents of the message as well as which fields will be present. One of the TYPE_* constants.

$casts

Attribute name => type token (`"LiveChatMessageSnippet"`, `"Array of Thumbnail"`, `"Map of VideoLocalization"`), used to hydrate nested objects into parts.

protected array<string, string> $casts = ['fanFundingEventDetails' => 'LiveChatFanFundingEventDetails', 'giftDetails' => 'LiveChatGiftDetails', 'giftMembershipReceivedDetails' => 'LiveChatGiftMembershipReceivedDetails', 'memberMilestoneChatDetails' => 'LiveChatMemberMilestoneChatDetails', 'membershipGiftingDetails' => 'LiveChatMembershipGiftingDetails', 'messageDeletedDetails' => 'LiveChatMessageDeletedDetails', 'messageRetractedDetails' => 'LiveChatMessageRetractedDetails', 'newSponsorDetails' => 'LiveChatNewSponsorDetails', 'pollDetails' => 'LiveChatPollDetails', 'superChatDetails' => 'LiveChatSuperChatDetails', 'superStickerDetails' => 'LiveChatSuperStickerDetails', 'textMessageDetails' => 'LiveChatTextMessageDetails', 'userBannedDetails' => 'LiveChatUserBannedMessageDetails']

$dates

Attribute names holding RFC 3339 timestamps, read back as {@see CarbonImmutable}. They are stored and serialised as the strings YouTube sent.

protected array<int, string> $dates = ['publishedAt']

Methods

__construct()

public __construct([YouTube|null $youtube = null ][, array<string, mixed>|object $attributes = [] ]) : mixed
Parameters
$youtube : YouTube|null = null

The client, for behaviour that calls the API.

$attributes : array<string, mixed>|object = []

__debugInfo()

public __debugInfo() : array<string, mixed>
Return values
array<string, mixed>

__get()

public __get(string $name) : mixed
Parameters
$name : string

__isset()

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

__set()

public __set(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed

__toString()

public __toString() : string
Return values
string

__unset()

public __unset(string $name) : void
Parameters
$name : string

attributeExists()

public attributeExists(string $key) : bool
Parameters
$key : string
Return values
bool

fill()

public fill(array<string, mixed> $attributes) : void
Parameters
$attributes : array<string, mixed>

getAttribute()

public getAttribute(string $key) : mixed
Parameters
$key : string

getCasts()

public getCasts() : array<string, string>
Return values
array<string, string>

getDates()

public getDates() : array<int, string>
Return values
array<int, string>

getRawAttribute()

Reads straight from the attribute bag, skipping the `get{Key}Attribute` hook.

public getRawAttribute(string $key) : mixed
Parameters
$key : string

getRawAttributes()

public getRawAttributes() : array<string, mixed>
Return values
array<string, mixed>

getYouTube()

The client this part came from.

public getYouTube() : YouTube
Tags
throws
LogicException

When the part was built without one.

Return values
YouTube

jsonSerialize()

The payload this part would be sent back to YouTube as: nested parts and collections flattened, timestamps as RFC 3339 strings.

public jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>

offsetExists()

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed

offsetSet()

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed

offsetUnset()

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

setAttribute()

public setAttribute(string $key, mixed $value) : void
Parameters
$key : string
$value : mixed

factory()

Builds another part from the same client - for nested objects.

protected factory() : Factory
Return values
Factory

setRawAttribute()

Writes straight to the attribute bag, skipping the `set{Key}Attribute` hook and any cast. For use *inside* a mutator, which would otherwise have no way to store its shaped value without recursing through {@see setAttribute()}.

protected setRawAttribute(string $key, mixed $value) : void
Parameters
$key : string
$value : mixed
On this page

Search results