Message
Represents a message in a chatroom.
Extends
BaseMessage<T>
Type parameters
| Type parameter |
|---|
T extends EventSubConnection |
Constructors
new Message()
1new Message<T>(2 chatbot: ChatBot<T>,3 data: MessageData<T>,4chatroom: ChatRoom<T>): Message<T>Creates a new instance of the message.
Parameters
| Parameter | Type | Description |
|---|---|---|
chatbot | ChatBot<T> | The current instance of the chatbot. |
data | MessageData<T> | The data of the message. |
chatroom | ChatRoom<T> | The chatroom where the message was sent. |
Returns
Message<T>
Overrides
Source
twitchfy/packages/chatbot/src/structures/Message.ts:76
Properties
| Property | Modifier | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|---|
author | readonly | BaseUser<T> | The author of the message. | BaseMessage.author | BaseMessage.author |
bits | readonly | number | The bits cheered in the message. | - | - |
chatbot | readonly | ChatBot<T> | The current instance of the chatbot. | BaseMessage.chatbot | BaseMessage.chatbot |
chatroom | readonly | ChatRoom<T> | The chatroom where the message was sent. | - | - |
cheermotes | readonly | Collection<string, BaseCheermote<T>> | The cheermotes in the message. | - | - |
content | readonly | string | The content of the message. | BaseMessage.content | BaseMessage.content |
emotes | readonly | Collection<string, BaseEmote<T, EmoteType>> | The emotes in the message. | - | - |
id | readonly | string | The id of the message. | BaseMessage.id | BaseMessage.id |
mentions | readonly | Collection<string, BaseUser<T>> | The mentions in the message. | - | - |
messageReply | readonly | null | MessageReply<T> | The message reply of the message. Null if the message doesn’t have a reply. | - | - |
rewardId | readonly | null | string | The reward Id of the message. Null if the message doesn’t have a reward redemption. | - | - |
type | readonly | MessageTypes | The type of the message. | - | - |
Accessors
authorId
1get authorId(): stringThe Id of the author of the message.
Returns
string
Source
twitchfy/packages/chatbot/src/structures/Message.ts:93
chatroomId
1get chatroomId(): stringThe Id of the chatroom where the message was sent.
Returns
string
Source
twitchfy/packages/chatbot/src/structures/BaseMessage.ts:64
hasRewardRedeemption
1get hasRewardRedeemption(): booleanWhether the message has a reward reedemption.
Returns
boolean
Source
twitchfy/packages/chatbot/src/structures/Message.ts:142
isChannelPointsSubOnly
1get isChannelPointsSubOnly(): booleanWhether the message was sent by the send in subscriber mode reward.
Returns
boolean
Source
twitchfy/packages/chatbot/src/structures/Message.ts:114
isHighlighted
1get isHighlighted(): booleanWhether the message was highlighted by the highlight message reward.
Returns
boolean
Source
twitchfy/packages/chatbot/src/structures/Message.ts:107
isText
1get isText(): booleanWhether the message is a normal text message.
Returns
boolean
Source
twitchfy/packages/chatbot/src/structures/Message.ts:100
isUserIntro
1get isUserIntro(): booleanWhether the message is an user intro message.
Returns
boolean
Source
twitchfy/packages/chatbot/src/structures/Message.ts:121
parentReply
1get 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
1get self(): booleanWhether the message was sent by the chatbot.
Returns
boolean
Source
twitchfy/packages/chatbot/src/structures/BaseMessage.ts:71
threadReply
1get 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()
1delete(): Promise<void>Deletes the message from the chatroom.
Returns
Promise<void>
Inherited from
Source
twitchfy/packages/chatbot/src/structures/BaseMessage.ts:48
reply()
1reply(message: string): Promise<BaseMessage<T>>Replies to the message.
Parameters
| Parameter | Type | Description |
|---|---|---|
message | string | The message to reply with. |
Returns
Promise<BaseMessage<T>>
The message that was sent as a reply.