ChannelProfile
Represents a channel profile created when the chatbot joins to a channel.
Extends
Base
<T
>
Type parameters
Type parameter |
---|
T extends EventSubConnection |
Constructors
new ChannelProfile()
Creates a new instance of the channel profile.
Parameters
Parameter | Type | Description |
---|---|---|
chatbot | ChatBot <T > | The current instance of the chatbot. |
data | ChannelProfileData | The data of the channel profile. |
Returns
Overrides
Base<T>.constructor
Source
twitchfy/packages/chatbot/src/structures/ChannelProfile.ts:28
Properties
Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
chatbot | readonly | ChatBot <T > | The current instance of the chatbot. | Base.chatbot |
events | readonly | ( | "ChannelChatClear" | "ChannelFollow" | "ChannelUpdate" | "StreamOnline" | "ChannelChatMessage" )[] | The events from the channel that the chatbot is subscribed to. | - |
id | readonly | string | The Id of the channel. | - |
Methods
addEvent()
addEvent(event)
Adds an event or events to the channel profile and listen to it. If the event is already added, it does nothing.
Parameters
Parameter | Type | Description |
---|---|---|
event | | "ChannelChatClear" | "ChannelFollow" | "ChannelUpdate" | "StreamOnline" | "ChannelChatMessage" | The event or events to add. |
Returns
Promise
<void
>
Source
twitchfy/packages/chatbot/src/structures/ChannelProfile.ts:34
addEvent(event)
Adds an event or events to the channel profile and listen to it. If the event is already added, it does nothing.
Parameters
Parameter | Type | Description |
---|---|---|
event | ( | "ChannelChatClear" | "ChannelFollow" | "ChannelUpdate" | "StreamOnline" | "ChannelChatMessage" )[] | The event or events to add. |
Returns
Promise
<void
>
Source
twitchfy/packages/chatbot/src/structures/ChannelProfile.ts:35
fetch()
Fetches the current channel of the profile from the API.
Returns
Promise
<Channel
<T
>>
The fetched channel from the API.
Source
twitchfy/packages/chatbot/src/structures/ChannelProfile.ts:76
hasEvent()
Checks if one event is being listened.
Parameters
Parameter | Type | Description |
---|---|---|
event | | "ChannelChatClear" | "ChannelFollow" | "ChannelUpdate" | "StreamOnline" | "ChannelChatMessage" | The event to check. |
Returns
boolean
Source
twitchfy/packages/chatbot/src/structures/ChannelProfile.ts:68
removeEvent()
Removes an event from the channel profile and stop listening to it. If the event is not added, it does nothing.
Parameters
Parameter | Type | Description |
---|---|---|
event | | "ChannelChatClear" | "ChannelFollow" | "ChannelUpdate" | "StreamOnline" | "ChannelChatMessage" | The event to remove. |
Returns
Promise
<void
>
Source
twitchfy/packages/chatbot/src/structures/ChannelProfile.ts:57