Skip to content

Author

Represents the author of a received message.

Extends

Type parameters

Type parameter
T extends EventSubConnection

Constructors

new Author()

1
new Author<T>(chatbot: ChatBot<T>, data: BaseUserData & object): Author<T>

Creates a new instance of the author.

Parameters

ParameterTypeDescription
chatbotChatBot<T>The current instance of the chatbot.
dataBaseUserData & objectThe data of the user.

Returns

Author<T>

Overrides

BaseUser.constructor

Source

twitchfy/packages/chatbot/src/structures/Author.ts:29

Properties

PropertyModifierTypeDescriptionInherited from
badgesreadonlyBadgeManager<T>The set of badges of the author.-
chatbotreadonlyChatBot<T>The current instance of the chatbot.BaseUser.chatbot
colorreadonlystringThe name color of the author in HEX RGB format.-
displayNamereadonlystringThe display name of the user.BaseUser.displayName
idreadonlystringThe id of the user.BaseUser.id
usernamereadonlystringThe username of the user.BaseUser.username

Accessors

broadcaster

1
get broadcaster(): boolean

Checks if the author is the broadcaster of the chatroom.

Returns

boolean

Source

twitchfy/packages/chatbot/src/structures/Author.ts:37


moderator

1
get moderator(): boolean

Checks if the author is a moderator of the chatroom.

Returns

boolean

Source

twitchfy/packages/chatbot/src/structures/Author.ts:44


subscriber

1
get subscriber(): boolean

Checks if the author is a subscriber of the channel.

Returns

boolean

Source

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


subscriptionMonths

1
get subscriptionMonths(): number

Gets the subscription months of the author. If the author is not a subscriber, it will return 0.

Returns

number

Source

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


subscriptionTier

1
get subscriptionTier(): null | number

Gets the subscription tier of the author. If the author is not a subscriber, it will return a nullish value.

Returns

null | number

Source

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


vip

1
get vip(): boolean

Checks if the author is a VIP of the chatroom.

Returns

boolean

Source

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

Methods

channel()

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

Returns

Promise<Channel<T>>

Inherited from

BaseUser.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

BaseUser.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

BaseUser.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

BaseUser.inStream

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.

Inherited from

BaseUser.stream

Source

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


toString()

1
toString(): string

Returns the mention of the user.

Returns

string

Inherited from

BaseUser.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

BaseUser.whisper

Source

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