ChannelManager
Represents the chatbot channel manager used to join to channels.
Extends
Base
<T
>
Type parameters
Type parameter |
---|
T extends EventSubConnection |
Constructors
new ChannelManager()
1new ChannelManager<T>(chatbot: ChatBot<T>): ChannelManager<T>
Creates a new instance of the channel manager.
Parameters
Parameter | Type | Description |
---|---|---|
chatbot | ChatBot <T > | The current instance of the chatbot. |
Returns
Overrides
Base<T>.constructor
Source
twitchfy/packages/chatbot/src/structures/managers/ChannelManager.ts:19
Properties
Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
chatbot | readonly | ChatBot <T > | The current instance of the chatbot. | Base.chatbot |
Methods
fetch()
1fetch(id: string): Promise<Channel<T>>
Fetches a channel by id.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The id of the channel to fetch. |
Returns
Promise
<Channel
<T
>>
A class representation of the channel. See Channel.
Source
twitchfy/packages/chatbot/src/structures/managers/ChannelManager.ts:104
join()
1join(id: string, events?: (2 | "ChannelChatClear"3 | "ChannelFollow"4 | "ChannelUpdate"5 | "StreamOnline"6| "ChannelChatMessage")[]): Promise<ChannelProfile<T>>
Join a channel and listen to messages.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The id of the channel to join. |
events ? | ( | "ChannelChatClear" | "ChannelFollow" | "ChannelUpdate" | "StreamOnline" | "ChannelChatMessage" )[] | The EventSub events you will listen to. See ChannelEvents. |
Returns
Promise
<ChannelProfile
<T
>>
A class representation of the channel profile which contains the events you are subscribed with. See ChannelProfile.
Source
twitchfy/packages/chatbot/src/structures/managers/ChannelManager.ts:29
leave()
1leave(id: string): Promise<void>
Leave a channel. You will no longer listen to messages and the other events you’ve subscribed.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The id of the channel to leave. |
Returns
Promise
<void
>
Source
twitchfy/packages/chatbot/src/structures/managers/ChannelManager.ts:70