Skip to content

Message

Represents a message in a chatroom.

Extends

Type parameters

Type parameter
T extends EventSubConnection

Constructors

new Message()

1
new Message<T>(
2
chatbot: ChatBot<T>,
3
data: MessageData<T>,
4
chatroom: ChatRoom<T>): Message<T>

Creates a new instance of the message.

Parameters

ParameterTypeDescription
chatbotChatBot<T>The current instance of the chatbot.
dataMessageData<T>The data of the message.
chatroomChatRoom<T>The chatroom where the message was sent.

Returns

Message<T>

Overrides

BaseMessage.constructor

Source

twitchfy/packages/chatbot/src/structures/Message.ts:76

Properties

PropertyModifierTypeDescriptionOverridesInherited from
authorreadonlyBaseUser<T>The author of the message.BaseMessage.authorBaseMessage.author
bitsreadonlynumberThe bits cheered in the message.--
chatbotreadonlyChatBot<T>The current instance of the chatbot.BaseMessage.chatbotBaseMessage.chatbot
chatroomreadonlyChatRoom<T>The chatroom where the message was sent.--
cheermotesreadonlyCollection<string, BaseCheermote<T>>The cheermotes in the message.--
contentreadonlystringThe content of the message.BaseMessage.contentBaseMessage.content
emotesreadonlyCollection<string, BaseEmote<T, EmoteType>>The emotes in the message.--
idreadonlystringThe id of the message.BaseMessage.idBaseMessage.id
mentionsreadonlyCollection<string, BaseUser<T>>The mentions in the message.--
messageReplyreadonlynull | MessageReply<T>The message reply of the message. Null if the message doesn’t have a reply.--
rewardIdreadonlynull | stringThe reward Id of the message. Null if the message doesn’t have a reward redemption.--
typereadonlyMessageTypesThe type of the message.--

Accessors

authorId

1
get authorId(): string

The Id of the author of the message.

Returns

string

Source

twitchfy/packages/chatbot/src/structures/Message.ts:93


chatroomId

1
get chatroomId(): string

The Id of the chatroom where the message was sent.

Returns

string

Source

twitchfy/packages/chatbot/src/structures/BaseMessage.ts:64


hasRewardRedeemption

1
get hasRewardRedeemption(): boolean

Whether the message has a reward reedemption.

Returns

boolean

Source

twitchfy/packages/chatbot/src/structures/Message.ts:142


isChannelPointsSubOnly

1
get isChannelPointsSubOnly(): boolean

Whether the message was sent by the send in subscriber mode reward.

Returns

boolean

Source

twitchfy/packages/chatbot/src/structures/Message.ts:114


isHighlighted

1
get isHighlighted(): boolean

Whether the message was highlighted by the highlight message reward.

Returns

boolean

Source

twitchfy/packages/chatbot/src/structures/Message.ts:107


isText

1
get isText(): boolean

Whether the message is a normal text message.

Returns

boolean

Source

twitchfy/packages/chatbot/src/structures/Message.ts:100


isUserIntro

1
get isUserIntro(): boolean

Whether the message is an user intro message.

Returns

boolean

Source

twitchfy/packages/chatbot/src/structures/Message.ts:121


parentReply

1
get parentReply(): null | MessageReplyParent<T>

The message which was replied by this message. Null if the message doesn’t have a reply.

Returns

null | MessageReplyParent<T>

Source

twitchfy/packages/chatbot/src/structures/Message.ts:128


self

1
get self(): boolean

Whether the message was sent by the chatbot.

Returns

boolean

Source

twitchfy/packages/chatbot/src/structures/BaseMessage.ts:71


threadReply

1
get threadReply(): null | MessageReplyThread<T>

The start message of the thread where this message is part of. Null if the message is not part of a thread.

Returns

null | MessageReplyThread<T>

Source

twitchfy/packages/chatbot/src/structures/Message.ts:135

Methods

delete()

1
delete(): Promise<void>

Deletes the message from the chatroom.

Returns

Promise<void>

Inherited from

BaseMessage.delete

Source

twitchfy/packages/chatbot/src/structures/BaseMessage.ts:48


reply()

1
reply(message: string): Promise<BaseMessage<T>>

Replies to the message.

Parameters

ParameterTypeDescription
messagestringThe message to reply with.

Returns

Promise<BaseMessage<T>>

The message that was sent as a reply.

Inherited from

BaseMessage.reply

Source

twitchfy/packages/chatbot/src/structures/BaseMessage.ts:57