Skip to content

ChatRoom

Represents a Twitch chatroom of a channel.

Extends

  • Base<T>

Type parameters

Type parameter
T extends EventSubConnection

Constructors

new ChatRoom()

1
new ChatRoom<T>(chatbot: ChatBot<T>, data: ChatRoomData): ChatRoom<T>

Creates a new instance of the chatroom.

Parameters

ParameterTypeDescription
chatbotChatBot<T>The current instance of the chatbot.
dataChatRoomDataThe data of the chatroom.

Returns

ChatRoom<T>

Overrides

Base<T>.constructor

Source

twitchfy/packages/chatbot/src/structures/ChatRoom.ts:65

Properties

PropertyModifierTypeDescriptionInherited from
automodreadonlyAutoMod<T>The automod manager of the chatroom.-
bansreadonlyBanManager<T>The ban manager of the chatroom.-
broadcasterreadonlyBaseUser<T>The broadcaster who owns the chatroom.-
channelreadonlyBaseChannel<T>The channel of the chatroom.-
chatbotreadonlyChatBot<T>The current instance of the chatbot.Base.chatbot
messagesreadonlyMessageManager<T>The message manager of the chatroom.-
settingsreadonlyChatRoomSettingsManager<T>The settings manager of the chatroom.-
timeoutsreadonlyTimeoutManager<T>The timeout manager of the chatroom.-
warnsreadonlyWarnsManager<T>The warns manager of the chatroom.-

Accessors

id

1
get id(): string

The Id of the chatroom. Its id is the same as the broadcaster id.

Returns

string

Source

twitchfy/packages/chatbot/src/structures/ChatRoom.ts:81

Methods

announce()

1
announce(options: AnnouncementOptions): Promise<void>

Sends an announcement to the chatroom.

Parameters

ParameterTypeDescription
optionsAnnouncementOptionsThe options of the announcement. See AnnouncementOptions

Returns

Promise<void>

The announcement that was sent.

Source

twitchfy/packages/chatbot/src/structures/ChatRoom.ts:153


send()

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

Sends a message to the chatroom.

Parameters

ParameterTypeDescription
messagestringThe message to send.

Returns

Promise<BaseMessage<T>>

The message that was sent. See BaseMessage

Source

twitchfy/packages/chatbot/src/structures/ChatRoom.ts:90


setChatDelay()

1
setChatDelay(duration: null | 2 | 4 | 6): Promise<ChatRoomSettings<T>>

Sets the chat delay of the chatroom.

Parameters

ParameterTypeDescription
durationnull | 2 | 4 | 6The duration of the chat delay in seconds. If null, it will disable the chat delay.

Returns

Promise<ChatRoomSettings<T>>

The updated settings of the chatroom.

Source

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


setEmoteOnlyMode()

1
setEmoteOnlyMode(enabled: boolean): Promise<ChatRoomSettings<T>>

Sets the emote only mode of the chatroom.

Parameters

ParameterTypeDescription
enabledbooleanWhether the emote only mode is enabled.

Returns

Promise<ChatRoomSettings<T>>

The updated settings of the chatroom.

Source

twitchfy/packages/chatbot/src/structures/ChatRoom.ts:144


setFollowersMode()

1
setFollowersMode(duration: null | number): Promise<ChatRoomSettings<T>>

Sets the followers mode of the chatroom.

Parameters

ParameterTypeDescription
durationnull | numberThe time, in seconds, the followers must be following the broadcaster to be able to send a message. If null, it will disable the followers mode.

Returns

Promise<ChatRoomSettings<T>>

The updated settings of the chatroom.

Source

twitchfy/packages/chatbot/src/structures/ChatRoom.ts:108


setSlowMode()

1
setSlowMode(duration: null | number): Promise<ChatRoomSettings<T>>

Sets the slow mode of the chatroom.

Parameters

ParameterTypeDescription
durationnull | numberThe duration of the slow mode in seconds. If null, it will disable the slow mode.

Returns

Promise<ChatRoomSettings<T>>

The updated settings of the chatroom.

Source

twitchfy/packages/chatbot/src/structures/ChatRoom.ts:99


setSubscribersMode()

1
setSubscribersMode(enabled: boolean): Promise<ChatRoomSettings<T>>

Sets the subscribers mode of the chatroom.

Parameters

ParameterTypeDescription
enabledbooleanWhether the subscribers mode is enabled.

Returns

Promise<ChatRoomSettings<T>>

The updated settings of the chatroom.

Source

twitchfy/packages/chatbot/src/structures/ChatRoom.ts:117


setUniqueMessagesMode()

1
setUniqueMessagesMode(enabled: boolean): Promise<ChatRoomSettings<T>>

Sets the unique messages mode of the chatroom.

Parameters

ParameterTypeDescription
enabledbooleanWhether the unique messages mode is enabled.

Returns

Promise<ChatRoomSettings<T>>

The updated settings of the chatroom.

Source

twitchfy/packages/chatbot/src/structures/ChatRoom.ts:126


shoutout()

1
shoutout(receiverId: string): Promise<void>

Sends a shoutout to a user in the chatroom.

Parameters

ParameterTypeDescription
receiverIdstringThe Id of the user to shoutout.

Returns

Promise<void>

The shoutout that was sent.

Source

twitchfy/packages/chatbot/src/structures/ChatRoom.ts:162