Skip to content

BaseUser

The base class for a user.

Extends

  • Base<T>

Extended by

Type parameters

Type parameter
T extends EventSubConnection

Constructors

new BaseUser()

1
new BaseUser<T>(chatbot: ChatBot<T>, data: BaseUserData): BaseUser<T>

Creates a new instance of the base user.

Parameters

ParameterTypeDescription
chatbotChatBot<T>The current instance of the chatbot.
dataBaseUserDataThe base data of the user.

Returns

BaseUser<T>

Overrides

Base<T>.constructor

Source

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

Properties

PropertyModifierTypeDescriptionInherited from
chatbotreadonlyChatBot<T>The current instance of the chatbot.Base.chatbot
displayNamereadonlystringThe display name of the user.-
idreadonlystringThe id of the user.-
usernamereadonlystringThe username of the user.-

Methods

channel()

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

Returns

Promise<Channel<T>>

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.

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.

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.

Source

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


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.

Source

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


toString()

1
toString(): string

Returns the mention of the user.

Returns

string

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>

Source

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