Author
Represents the author of a received message.
Extends
BaseUser
<T
>
Type parameters
Type parameter |
---|
T extends EventSubConnection |
Constructors
new Author()
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
Checks if the author is the broadcaster of the chatroom.
Returns
boolean
Source
twitchfy/packages/chatbot/src/structures/Author.ts:37
moderator
Checks if the author is a moderator of the chatroom.
Returns
boolean
Source
twitchfy/packages/chatbot/src/structures/Author.ts:44
subscriber
Checks if the author is a subscriber of the channel.
Returns
boolean
Source
twitchfy/packages/chatbot/src/structures/Author.ts:58
subscriptionMonths
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
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
Checks if the author is a VIP of the chatroom.
Returns
boolean
Source
twitchfy/packages/chatbot/src/structures/Author.ts:51
Methods
channel()
Returns
Promise
<Channel
<T
>>
Inherited from
Source
twitchfy/packages/chatbot/src/structures/BaseUser.ts:79
chatroom()
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()
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()
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()
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()
Returns the mention of the user.
Returns
string
Inherited from
Source
twitchfy/packages/chatbot/src/structures/BaseUser.ts:58
whisper()
Sends a whisper to the user.
Parameters
Parameter | Type | Description |
---|---|---|
message | string | The message to send. |
Returns
Promise
<void
>