TwitchLib.PubSub  3.0.2
The PubSub component of TwitchLib.
Public Member Functions | Events | List of all members
TwitchLib.PubSub.TwitchPubSub Class Reference

Class represneting interactions with the Twitch PubSub More...

Inheritance diagram for TwitchLib.PubSub.TwitchPubSub:
TwitchLib.PubSub.Interfaces.ITwitchPubSub

Public Member Functions

 TwitchPubSub (ILogger< TwitchPubSub > logger=null)
 Constructor for a client that interface's with Twitch's PubSub system. More...
 
void SendTopics (string oauth=null, bool unlisten=false)
 
void ListenToFollows (string channelId)
 Sends a request to listenOn follows coming into a specified channel. More...
 
void ListenToChatModeratorActions (string myTwitchId, string channelTwitchId)
 Sends a request to listenOn timeouts and bans in a specific channel More...
 
void ListenToChannelExtensionBroadcast (string channelId, string extensionId)
 Sends a request to ListenOn EBS broadcasts sent to a specific extension on a specific channel. More...
 
void ListenToBitsEvents (string channelTwitchId)
 Sends request to listenOn bits events in specific channel More...
 
void ListenToCommerce (string channelTwitchId)
 Sends request to listenOn channel commerce events in specific channel More...
 
void ListenToVideoPlayback (string channelName)
 Sends request to listenOn video playback events in specific channel More...
 
void ListenToWhispers (string channelTwitchId)
 Sends request to listen to whispers from specific channel. More...
 
void ListenToSubscriptions (string channelId)
 Sends request to listen to channel subscriptions. More...
 
void Connect ()
 Method to connect to Twitch's PubSub service. You MUST listen toOnConnected event and listen to a Topic within 15 seconds of connecting (or be disconnected) More...
 
void Disconnect ()
 What do you think it does? :) More...
 
void TestMessageParser (string testJsonString)
 This method will send passed json text to the message parser in order to allow forOn-demand parser testing. More...
 

Events

EventHandler OnPubSubServiceConnected
 Fires when PubSub Service is connected. More...
 
EventHandler< OnPubSubServiceErrorArgsOnPubSubServiceError
 Fires when PubSub Service has an error. More...
 
EventHandler OnPubSubServiceClosed
 Fires when PubSub Service is closed. More...
 
EventHandler< OnListenResponseArgsOnListenResponse
 Fires when PubSub receives any response. More...
 
EventHandler< OnTimeoutArgsOnTimeout
 Fires when PubSub receives notice a viewer gets a timeout. More...
 
EventHandler< OnBanArgsOnBan
 Fires when PubSub receives notice a viewer gets banned. More...
 
EventHandler< OnUnbanArgsOnUnban
 Fires when PubSub receives notice a viewer gets unbanned. More...
 
EventHandler< OnUntimeoutArgsOnUntimeout
 Fires when PubSub receives notice a viewer gets a timeout removed. More...
 
EventHandler< OnHostArgsOnHost
 Fires when PubSub receives notice that the channel being listened to is hosting another channel. More...
 
EventHandler< OnSubscribersOnlyArgsOnSubscribersOnly
 Fires when PubSub receives notice that Sub-Only Mode gets turned on. More...
 
EventHandler< OnSubscribersOnlyOffArgsOnSubscribersOnlyOff
 Fires when PubSub receives notice that Sub-Only Mode gets turned off. More...
 
EventHandler< OnClearArgsOnClear
 Fires when PubSub receives notice that chat gets cleared. More...
 
EventHandler< OnEmoteOnlyArgsOnEmoteOnly
 Fires when PubSub receives notice that Emote-Only Mode gets turned on. More...
 
EventHandler< OnEmoteOnlyOffArgsOnEmoteOnlyOff
 Fires when PubSub receives notice that Emote-Only Mode gets turned off. More...
 
EventHandler< OnR9kBetaArgsOnR9kBeta
 Fires when PubSub receives notice that the chat option R9kBeta gets turned on. More...
 
EventHandler< OnR9kBetaOffArgsOnR9kBetaOff
 Fires when PubSub receives notice that the chat option R9kBeta gets turned off. More...
 
EventHandler< OnBitsReceivedArgsOnBitsReceived
 Fires when PubSub receives notice of a bit donation. More...
 
EventHandler< OnChannelCommerceReceivedArgsOnChannelCommerceReceived
 Fires when PubSub receives notice of a commerce transaction. More...
 
EventHandler< OnStreamUpArgsOnStreamUp
 Fires when PubSub receives notice that the stream of the channel being listened to goes online. More...
 
EventHandler< OnStreamDownArgsOnStreamDown
 Fires when PubSub receives notice that the stream of the channel being listened to goes offline. More...
 
EventHandler< OnViewCountArgsOnViewCount
 Fires when PubSub receives notice view count has changed. More...
 
EventHandler< OnWhisperArgsOnWhisper
 Fires when PubSub receives a whisper. More...
 
EventHandler< OnChannelSubscriptionArgsOnChannelSubscription
 Fires when PubSub receives notice when the channel being listened to gets a subscription. More...
 
EventHandler< OnChannelExtensionBroadcastArgsOnChannelExtensionBroadcast
 Fires when PubSub receives a message sent to the specified extension on the specified channel. More...
 
EventHandler< OnFollowArgsOnFollow
 Fires when PubSub receives notice when a user follows the designated channel. More...
 
- Events inherited from TwitchLib.PubSub.Interfaces.ITwitchPubSub
EventHandler< OnBanArgsOnBan
 
EventHandler< OnBitsReceivedArgsOnBitsReceived
 
EventHandler< OnChannelSubscriptionArgsOnChannelSubscription
 
EventHandler< OnClearArgsOnClear
 
EventHandler< OnEmoteOnlyArgsOnEmoteOnly
 
EventHandler< OnEmoteOnlyOffArgsOnEmoteOnlyOff
 
EventHandler< OnHostArgsOnHost
 
EventHandler< OnListenResponseArgsOnListenResponse
 
EventHandler OnPubSubServiceClosed
 
EventHandler OnPubSubServiceConnected
 
EventHandler< OnPubSubServiceErrorArgsOnPubSubServiceError
 
EventHandler< OnR9kBetaArgsOnR9kBeta
 
EventHandler< OnR9kBetaOffArgsOnR9kBetaOff
 
EventHandler< OnStreamDownArgsOnStreamDown
 
EventHandler< OnStreamUpArgsOnStreamUp
 
EventHandler< OnSubscribersOnlyArgsOnSubscribersOnly
 
EventHandler< OnSubscribersOnlyOffArgsOnSubscribersOnlyOff
 
EventHandler< OnTimeoutArgsOnTimeout
 
EventHandler< OnUnbanArgsOnUnban
 
EventHandler< OnUntimeoutArgsOnUntimeout
 
EventHandler< OnViewCountArgsOnViewCount
 
EventHandler< OnWhisperArgsOnWhisper
 

Detailed Description

Class represneting interactions with the Twitch PubSub

Constructor & Destructor Documentation

◆ TwitchPubSub()

TwitchLib.PubSub.TwitchPubSub.TwitchPubSub ( ILogger< TwitchPubSub logger = null)

Constructor for a client that interface's with Twitch's PubSub system.

Parameters
loggerOptional ILogger param to enable logging

Member Function Documentation

◆ Connect()

void TwitchLib.PubSub.TwitchPubSub.Connect ( )

Method to connect to Twitch's PubSub service. You MUST listen toOnConnected event and listen to a Topic within 15 seconds of connecting (or be disconnected)

Implements TwitchLib.PubSub.Interfaces.ITwitchPubSub.

◆ Disconnect()

void TwitchLib.PubSub.TwitchPubSub.Disconnect ( )

What do you think it does? :)

Implements TwitchLib.PubSub.Interfaces.ITwitchPubSub.

◆ ListenToBitsEvents()

void TwitchLib.PubSub.TwitchPubSub.ListenToBitsEvents ( string  channelTwitchId)

Sends request to listenOn bits events in specific channel

Parameters
channelTwitchIdChannel Id of channel to listen to bits on (can be fetched from TwitchApi)

Implements TwitchLib.PubSub.Interfaces.ITwitchPubSub.

◆ ListenToChannelExtensionBroadcast()

void TwitchLib.PubSub.TwitchPubSub.ListenToChannelExtensionBroadcast ( string  channelId,
string  extensionId 
)

Sends a request to ListenOn EBS broadcasts sent to a specific extension on a specific channel.

Parameters
channelIdId of the channel that the extension lives on.
extensionId

◆ ListenToChatModeratorActions()

void TwitchLib.PubSub.TwitchPubSub.ListenToChatModeratorActions ( string  myTwitchId,
string  channelTwitchId 
)

Sends a request to listenOn timeouts and bans in a specific channel

Parameters
myTwitchIdA moderator's twitch acount's ID (can be fetched from TwitchApi)
channelTwitchIdChannel ID who has previous parameter's moderator (can be fetched from TwitchApi)

Implements TwitchLib.PubSub.Interfaces.ITwitchPubSub.

◆ ListenToCommerce()

void TwitchLib.PubSub.TwitchPubSub.ListenToCommerce ( string  channelTwitchId)

Sends request to listenOn channel commerce events in specific channel

Parameters
channelTwitchIdChannel Id of channel to listen to commerce events on.

◆ ListenToFollows()

void TwitchLib.PubSub.TwitchPubSub.ListenToFollows ( string  channelId)

Sends a request to listenOn follows coming into a specified channel.

Parameters
channelTwitchIdChannel ID to watch for new followers on.

◆ ListenToSubscriptions()

void TwitchLib.PubSub.TwitchPubSub.ListenToSubscriptions ( string  channelId)

Sends request to listen to channel subscriptions.

Parameters
channelIdId of the channel to listen to.

Implements TwitchLib.PubSub.Interfaces.ITwitchPubSub.

◆ ListenToVideoPlayback()

void TwitchLib.PubSub.TwitchPubSub.ListenToVideoPlayback ( string  channelName)

Sends request to listenOn video playback events in specific channel

Parameters
channelNameName of channel to listen to playback events in.

Implements TwitchLib.PubSub.Interfaces.ITwitchPubSub.

◆ ListenToWhispers()

void TwitchLib.PubSub.TwitchPubSub.ListenToWhispers ( string  channelTwitchId)

Sends request to listen to whispers from specific channel.

Parameters
channelTwitchIdChannel to listen to whispers on.

Implements TwitchLib.PubSub.Interfaces.ITwitchPubSub.

◆ SendTopics()

void TwitchLib.PubSub.TwitchPubSub.SendTopics ( string  oauth = null,
bool  unlisten = false 
)

◆ TestMessageParser()

void TwitchLib.PubSub.TwitchPubSub.TestMessageParser ( string  testJsonString)

This method will send passed json text to the message parser in order to allow forOn-demand parser testing.

Parameters
testJsonString

Implements TwitchLib.PubSub.Interfaces.ITwitchPubSub.

Event Documentation

◆ OnBan

EventHandler<OnBanArgs> TwitchLib.PubSub.TwitchPubSub.OnBan

Fires when PubSub receives notice a viewer gets banned.

◆ OnBitsReceived

EventHandler<OnBitsReceivedArgs> TwitchLib.PubSub.TwitchPubSub.OnBitsReceived

Fires when PubSub receives notice of a bit donation.

◆ OnChannelCommerceReceived

EventHandler<OnChannelCommerceReceivedArgs> TwitchLib.PubSub.TwitchPubSub.OnChannelCommerceReceived

Fires when PubSub receives notice of a commerce transaction.

◆ OnChannelExtensionBroadcast

EventHandler<OnChannelExtensionBroadcastArgs> TwitchLib.PubSub.TwitchPubSub.OnChannelExtensionBroadcast

Fires when PubSub receives a message sent to the specified extension on the specified channel.

◆ OnChannelSubscription

EventHandler<OnChannelSubscriptionArgs> TwitchLib.PubSub.TwitchPubSub.OnChannelSubscription

Fires when PubSub receives notice when the channel being listened to gets a subscription.

◆ OnClear

EventHandler<OnClearArgs> TwitchLib.PubSub.TwitchPubSub.OnClear

Fires when PubSub receives notice that chat gets cleared.

◆ OnEmoteOnly

EventHandler<OnEmoteOnlyArgs> TwitchLib.PubSub.TwitchPubSub.OnEmoteOnly

Fires when PubSub receives notice that Emote-Only Mode gets turned on.

◆ OnEmoteOnlyOff

EventHandler<OnEmoteOnlyOffArgs> TwitchLib.PubSub.TwitchPubSub.OnEmoteOnlyOff

Fires when PubSub receives notice that Emote-Only Mode gets turned off.

◆ OnFollow

EventHandler<OnFollowArgs> TwitchLib.PubSub.TwitchPubSub.OnFollow

Fires when PubSub receives notice when a user follows the designated channel.

◆ OnHost

EventHandler<OnHostArgs> TwitchLib.PubSub.TwitchPubSub.OnHost

Fires when PubSub receives notice that the channel being listened to is hosting another channel.

◆ OnListenResponse

EventHandler<OnListenResponseArgs> TwitchLib.PubSub.TwitchPubSub.OnListenResponse

Fires when PubSub receives any response.

◆ OnPubSubServiceClosed

EventHandler TwitchLib.PubSub.TwitchPubSub.OnPubSubServiceClosed

Fires when PubSub Service is closed.

◆ OnPubSubServiceConnected

EventHandler TwitchLib.PubSub.TwitchPubSub.OnPubSubServiceConnected

Fires when PubSub Service is connected.

◆ OnPubSubServiceError

EventHandler<OnPubSubServiceErrorArgs> TwitchLib.PubSub.TwitchPubSub.OnPubSubServiceError

Fires when PubSub Service has an error.

◆ OnR9kBeta

EventHandler<OnR9kBetaArgs> TwitchLib.PubSub.TwitchPubSub.OnR9kBeta

Fires when PubSub receives notice that the chat option R9kBeta gets turned on.

◆ OnR9kBetaOff

EventHandler<OnR9kBetaOffArgs> TwitchLib.PubSub.TwitchPubSub.OnR9kBetaOff

Fires when PubSub receives notice that the chat option R9kBeta gets turned off.

◆ OnStreamDown

EventHandler<OnStreamDownArgs> TwitchLib.PubSub.TwitchPubSub.OnStreamDown

Fires when PubSub receives notice that the stream of the channel being listened to goes offline.

◆ OnStreamUp

EventHandler<OnStreamUpArgs> TwitchLib.PubSub.TwitchPubSub.OnStreamUp

Fires when PubSub receives notice that the stream of the channel being listened to goes online.

◆ OnSubscribersOnly

EventHandler<OnSubscribersOnlyArgs> TwitchLib.PubSub.TwitchPubSub.OnSubscribersOnly

Fires when PubSub receives notice that Sub-Only Mode gets turned on.

◆ OnSubscribersOnlyOff

EventHandler<OnSubscribersOnlyOffArgs> TwitchLib.PubSub.TwitchPubSub.OnSubscribersOnlyOff

Fires when PubSub receives notice that Sub-Only Mode gets turned off.

◆ OnTimeout

EventHandler<OnTimeoutArgs> TwitchLib.PubSub.TwitchPubSub.OnTimeout

Fires when PubSub receives notice a viewer gets a timeout.

◆ OnUnban

EventHandler<OnUnbanArgs> TwitchLib.PubSub.TwitchPubSub.OnUnban

Fires when PubSub receives notice a viewer gets unbanned.

◆ OnUntimeout

EventHandler<OnUntimeoutArgs> TwitchLib.PubSub.TwitchPubSub.OnUntimeout

Fires when PubSub receives notice a viewer gets a timeout removed.

◆ OnViewCount

EventHandler<OnViewCountArgs> TwitchLib.PubSub.TwitchPubSub.OnViewCount

Fires when PubSub receives notice view count has changed.

◆ OnWhisper

EventHandler<OnWhisperArgs> TwitchLib.PubSub.TwitchPubSub.OnWhisper

Fires when PubSub receives a whisper.


The documentation for this class was generated from the following file: