Skip to content

ChatBotUser

Represents a Twitch chatbot user.

Extends

Type parameters

Type parameter
T extends EventSubConnection

Constructors

new ChatBotUser()

1
new ChatBotUser<T>(chatbot: ChatBot<T>, data: User): ChatBotUser<T>

Creates a new instance of the chatbot user.

Parameters

ParameterTypeDescription
chatbotChatBot<T>The current instance of the chatbot.
dataUserThe data of the user returned from the API.

Returns

ChatBotUser<T>

Overrides

User.constructor

Source

twitchfy/packages/chatbot/src/structures/ChatBotUser.ts:16

Properties

PropertyModifierTypeDescriptionInherited from
chatbotreadonlyChatBot<T>The current instance of the chatbot.User.chatbot
descriptionreadonlystringThe description of the user.User.description
displayNamereadonlystringThe display name of the user.User.displayName
idreadonlystringThe id of the user.User.id
profileImagereadonlystringThe profile image URL of the user.User.profileImage
usernamereadonlystringThe username of the user.User.username

Accessors

broadcasterType

1
get broadcasterType(): string

The user’s broadcaster type. Possible values are ‘partner’, ‘affiliate’ and ‘normal’.

Returns

string

Source

twitchfy/packages/chatbot/src/structures/User.ts:55


createdAt

1
get createdAt(): Date

When the user was created. A JavaScript Date object is returned.

Returns

Date

Source

twitchfy/packages/chatbot/src/structures/User.ts:41


offlineImage

1
get offlineImage(): null | string

The user’s offline image url. Returns null if the user has no offline image set

Returns

null | string

Source

twitchfy/packages/chatbot/src/structures/User.ts:62


userType

1
get userType(): string

The user’s type.

Returns

string

Source

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

Methods

channel()

1
channel(): Promise<Channel<T>>

Returns

Promise<Channel<T>>

Inherited from

User.channel

Source

twitchfy/packages/chatbot/src/structures/BaseUser.ts:79


chatroom()

1
chatroom(): Promise<ChatRoom<T>>

Gets the chatroom of the user.

Returns

Promise<ChatRoom<T>>

The chatroom of the user.

Inherited from

User.chatroom

Source

twitchfy/packages/chatbot/src/structures/BaseUser.ts:42


fetch()

1
fetch(): Promise<User<T>>

Fetches the current user from the API.

Returns

Promise<User<T>>

The fetched user from the API.

Inherited from

User.fetch

Source

twitchfy/packages/chatbot/src/structures/BaseUser.ts:51


inStream()

1
inStream(): Promise<boolean>

Checks whether the user is currently streaming.

Returns

Promise<boolean>

A boolean indicating whether the user is currently streaming.

Inherited from

User.inStream

Source

twitchfy/packages/chatbot/src/structures/BaseUser.ts:74


setNameColor()

1
setNameColor(color: string): Promise<void>

Sets the name color of the chatbot user which will be visible in the chat.

Parameters

ParameterTypeDescription
colorstringThe color of the name. This can be a hex color code or a color name.

Returns

Promise<void>

Source

twitchfy/packages/chatbot/src/structures/ChatBotUser.ts:25


stream()

1
stream(): Promise<null | Stream<T>>

Fetches the current stream of the user from the API.

Returns

Promise<null | Stream<T>>

The current stream or null if the stream is offline.

Inherited from

User.stream

Source

twitchfy/packages/chatbot/src/structures/BaseUser.ts:66


toString()

1
toString(): string

Returns the mention of the user.

Returns

string

Inherited from

User.toString

Source

twitchfy/packages/chatbot/src/structures/BaseUser.ts:58


whisper()

1
whisper(message: string): Promise<void>

Sends a whisper to the user.

Parameters

ParameterTypeDescription
messagestringThe message to send.

Returns

Promise<void>

Inherited from

User.whisper

Source

twitchfy/packages/chatbot/src/structures/BaseUser.ts:88