Class ChatMessage
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionChatMessage(@NotNull String broadcasterId, @NotNull String senderId, @NotNull String message, @Nullable String replyParentMessageId) Deprecated.ChatMessage(@NotNull String broadcasterId, @NotNull String senderId, @NotNull String message, @Nullable String replyParentMessageId, @Nullable Boolean forSourceOnly) Creates a newChatMessageinstance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()protected booleanbooleanThe ID of the broadcaster whose chat room the message will be sent to.Whether the chat message is sent only to the source channel (broadcaster_id) during a shared chat session.The message to send.The ID of the chat message being replied to, if any.The ID of the user sending the message.inthashCode()toString()withBroadcasterId(@NotNull String broadcasterId) The ID of the broadcaster whose chat room the message will be sent to.withForSourceOnly(@Nullable Boolean forSourceOnly) Whether the chat message is sent only to the source channel (broadcaster_id) during a shared chat session.withMessage(@NotNull String message) The message to send.withReplyParentMessageId(@Nullable String replyParentMessageId) The ID of the chat message being replied to, if any.withSenderId(@NotNull String senderId) The ID of the user sending the message.
-
Constructor Details
-
ChatMessage
@Deprecated public ChatMessage(@NotNull @NotNull String broadcasterId, @NotNull @NotNull String senderId, @NotNull @NotNull String message, @Nullable @Nullable String replyParentMessageId) Deprecated.in favor ofChatMessage(String, String, String, String, Boolean)orbuilder()Legacy Constructor- Parameters:
broadcasterId- The ID of the broadcaster whose chat room the message will be sent to.senderId- The ID of the user sending the message.message- The message to send.replyParentMessageId- The ID of the chat message being replied to, if any.
-
ChatMessage
public ChatMessage() -
ChatMessage
public ChatMessage(@NotNull @NotNull String broadcasterId, @NotNull @NotNull String senderId, @NotNull @NotNull String message, @Nullable @Nullable String replyParentMessageId, @Nullable @Nullable Boolean forSourceOnly) Creates a newChatMessageinstance.- Parameters:
broadcasterId- The ID of the broadcaster whose chat room the message will be sent to.senderId- The ID of the user sending the message.This ID must match the user ID in the user access token (if not using an app access token).
message- The message to send.The message is limited to a maximum of 500 characters.
replyParentMessageId- The ID of the chat message being replied to, if any.forSourceOnly- Whether the chat message is sent only to the source channel (broadcaster_id) during a shared chat session.NOTE: Can only be set when utilizing an App Access Token at the top. Cannot be specified when a User Access Token is used and will result in a 400 error.
Has no effect if the message is not sent during a shared chat session.
Introduced in April 2025, the default is temporarily “false”. On May 19, 2025 the default value for the for_source_only parameter will be updated to “true” (i.e. chat messages will be only shared with the source channel by default). If you prefer to send a chat message to both channels in a shared chat session, make sure this parameter is explicitly set to “false” in your API request before May 19.
-
-
Method Details
-
builder
-
toBuilder
-
withBroadcasterId
The ID of the broadcaster whose chat room the message will be sent to.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withSenderId
The ID of the user sending the message.This ID must match the user ID in the user access token (if not using an app access token).
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withMessage
The message to send.The message is limited to a maximum of 500 characters.
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withReplyParentMessageId
The ID of the chat message being replied to, if any.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withForSourceOnly
Whether the chat message is sent only to the source channel (broadcaster_id) during a shared chat session.NOTE: Can only be set when utilizing an App Access Token at the top. Cannot be specified when a User Access Token is used and will result in a 400 error.
Has no effect if the message is not sent during a shared chat session.
Introduced in April 2025, the default is temporarily “false”. On May 19, 2025 the default value for the for_source_only parameter will be updated to “true” (i.e. chat messages will be only shared with the source channel by default). If you prefer to send a chat message to both channels in a shared chat session, make sure this parameter is explicitly set to “false” in your API request before May 19.
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
getBroadcasterId
The ID of the broadcaster whose chat room the message will be sent to. -
getSenderId
The ID of the user sending the message.This ID must match the user ID in the user access token (if not using an app access token).
-
getMessage
The message to send.The message is limited to a maximum of 500 characters.
-
getReplyParentMessageId
The ID of the chat message being replied to, if any. -
getForSourceOnly
Whether the chat message is sent only to the source channel (broadcaster_id) during a shared chat session.NOTE: Can only be set when utilizing an App Access Token at the top. Cannot be specified when a User Access Token is used and will result in a 400 error.
Has no effect if the message is not sent during a shared chat session.
Introduced in April 2025, the default is temporarily “false”. On May 19, 2025 the default value for the for_source_only parameter will be updated to “true” (i.e. chat messages will be only shared with the source channel by default). If you prefer to send a chat message to both channels in a shared chat session, make sure this parameter is explicitly set to “false” in your API request before May 19.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
ChatMessage(String, String, String, String, Boolean)orbuilder()