User
Represents a Twitch user.
Extends
BaseUser
<T
>
Extended by
Type parameters
Type parameter |
---|
T extends EventSubConnection |
Constructors
new User()
Creates a new instance of the user.
Parameters
Parameter | Type | Description |
---|---|---|
chatbot | ChatBot <T > | The current instance of the chatbot. |
data | User | The data of the user returned from the API. |
Returns
User
<T
>
Overrides
Source
twitchfy/packages/chatbot/src/structures/User.ts:31
Properties
Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
chatbot | readonly | ChatBot <T > | The current instance of the chatbot. | BaseUser .chatbot |
description | readonly | string | The description of the user. | - |
displayName | readonly | string | The display name of the user. | BaseUser .displayName |
id | readonly | string | The id of the user. | BaseUser .id |
profileImage | readonly | string | The profile image URL of the user. | - |
username | readonly | string | The username of the user. | BaseUser .username |
Accessors
broadcasterType
The user’s broadcaster type. Possible values are ‘partner’, ‘affiliate’ and ‘normal’.
Returns
string
Source
twitchfy/packages/chatbot/src/structures/User.ts:55
createdAt
When the user was created. A JavaScript Date object is returned.
Returns
Date
Source
twitchfy/packages/chatbot/src/structures/User.ts:41
offlineImage
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
The user’s type.
Returns
string
Source
twitchfy/packages/chatbot/src/structures/User.ts:48
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
>