Skip to content

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()

1
new ChannelProfile<T>(chatbot: ChatBot<T>, data: ChannelProfileData): ChannelProfile<T>

Creates a new instance of the channel profile.

Parameters

ParameterTypeDescription
chatbotChatBot<T>The current instance of the chatbot.
dataChannelProfileDataThe data of the channel profile.

Returns

ChannelProfile<T>

Overrides

Base<T>.constructor

Source

twitchfy/packages/chatbot/src/structures/ChannelProfile.ts:28

Properties

PropertyModifierTypeDescriptionInherited from
chatbotreadonlyChatBot<T>The current instance of the chatbot.Base.chatbot
eventsreadonly( | "ChannelChatClear" | "ChannelFollow" | "ChannelUpdate" | "StreamOnline" | "ChannelChatMessage")[]The events from the channel that the chatbot is subscribed to.-
idreadonlystringThe Id of the channel.-

Methods

addEvent()

addEvent(event)

1
addEvent(event:
2
| "ChannelChatClear"
3
| "ChannelFollow"
4
| "ChannelUpdate"
5
| "StreamOnline"
6
| "ChannelChatMessage"): Promise<void>

Adds an event or events to the channel profile and listen to it. If the event is already added, it does nothing.

Parameters
ParameterTypeDescription
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)

1
addEvent(event: (
2
| "ChannelChatClear"
3
| "ChannelFollow"
4
| "ChannelUpdate"
5
| "StreamOnline"
6
| "ChannelChatMessage")[]): Promise<void>

Adds an event or events to the channel profile and listen to it. If the event is already added, it does nothing.

Parameters
ParameterTypeDescription
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()

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

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()

1
hasEvent(event:
2
| "ChannelChatClear"
3
| "ChannelFollow"
4
| "ChannelUpdate"
5
| "StreamOnline"
6
| "ChannelChatMessage"): boolean

Checks if one event is being listened.

Parameters

ParameterTypeDescription
event| "ChannelChatClear" | "ChannelFollow" | "ChannelUpdate" | "StreamOnline" | "ChannelChatMessage"The event to check.

Returns

boolean

Source

twitchfy/packages/chatbot/src/structures/ChannelProfile.ts:68


removeEvent()

1
removeEvent(event:
2
| "ChannelChatClear"
3
| "ChannelFollow"
4
| "ChannelUpdate"
5
| "StreamOnline"
6
| "ChannelChatMessage"): Promise<void>

Removes an event from the channel profile and stop listening to it. If the event is not added, it does nothing.

Parameters

ParameterTypeDescription
event| "ChannelChatClear" | "ChannelFollow" | "ChannelUpdate" | "StreamOnline" | "ChannelChatMessage"The event to remove.

Returns

Promise<void>

Source

twitchfy/packages/chatbot/src/structures/ChannelProfile.ts:57