Author
Represents the author of a received message.
Extends
BaseUser<T>
Type parameters
| Type parameter |
|---|
T extends EventSubConnection |
Constructors
new Author()
1new Author<T>(chatbot: ChatBot<T>, data: BaseUserData & object): Author<T>Creates a new instance of the author.
Parameters
| Parameter | Type | Description |
|---|---|---|
chatbot | ChatBot<T> | The current instance of the chatbot. |
data | BaseUserData & object | The data of the user. |
Returns
Author<T>
Overrides
Source
twitchfy/packages/chatbot/src/structures/Author.ts:29
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
badges | readonly | BadgeManager<T> | The set of badges of the author. | - |
chatbot | readonly | ChatBot<T> | The current instance of the chatbot. | BaseUser.chatbot |
color | readonly | string | The name color of the author in HEX RGB format. | - |
displayName | readonly | string | The display name of the user. | BaseUser.displayName |
id | readonly | string | The id of the user. | BaseUser.id |
username | readonly | string | The username of the user. | BaseUser.username |
Accessors
broadcaster
1get broadcaster(): booleanChecks if the author is the broadcaster of the chatroom.
Returns
boolean
Source
twitchfy/packages/chatbot/src/structures/Author.ts:37
moderator
1get moderator(): booleanChecks if the author is a moderator of the chatroom.
Returns
boolean
Source
twitchfy/packages/chatbot/src/structures/Author.ts:44
subscriber
1get subscriber(): booleanChecks if the author is a subscriber of the channel.
Returns
boolean
Source
twitchfy/packages/chatbot/src/structures/Author.ts:58
subscriptionMonths
1get subscriptionMonths(): numberGets 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
1get subscriptionTier(): null | numberGets 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
1get vip(): booleanChecks if the author is a VIP of the chatroom.
Returns
boolean
Source
twitchfy/packages/chatbot/src/structures/Author.ts:51
Methods
channel()
1channel(): Promise<Channel<T>>Returns
Promise<Channel<T>>
Inherited from
Source
twitchfy/packages/chatbot/src/structures/BaseUser.ts:79
chatroom()
1chatroom(): Promise<ChatRoom<T>>Gets the chatroom of the user.
Returns
Promise<ChatRoom<T>>
The chatroom of the user.
Inherited from
Source
twitchfy/packages/chatbot/src/structures/BaseUser.ts:42
fetch()
1fetch(): Promise<User<T>>Fetches the current user from the API.
Returns
Promise<User<T>>
The fetched user from the API.
Inherited from
Source
twitchfy/packages/chatbot/src/structures/BaseUser.ts:51
inStream()
1inStream(): Promise<boolean>Checks whether the user is currently streaming.
Returns
Promise<boolean>
A boolean indicating whether the user is currently streaming.
Inherited from
Source
twitchfy/packages/chatbot/src/structures/BaseUser.ts:74
stream()
1stream(): 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
Source
twitchfy/packages/chatbot/src/structures/BaseUser.ts:66
toString()
1toString(): stringReturns the mention of the user.
Returns
string
Inherited from
Source
twitchfy/packages/chatbot/src/structures/BaseUser.ts:58
whisper()
1whisper(message: string): Promise<void>Sends a whisper to the user.
Parameters
| Parameter | Type | Description |
|---|---|---|
message | string | The message to send. |
Returns
Promise<void>