C# Class TwitchLib.TwitchPubSub

Exibir arquivo Open project: swiftyspiffy/TwitchLib Class Usage Examples

Public Properties

Property Type Description
OnBan EventHandler
OnBitsReceived EventHandler
OnClear EventHandler
OnEmoteOnly EventHandler
OnEmoteOnlyOff EventHandler
OnHost EventHandler
OnListenResponse EventHandler
OnPubSubServiceClosed EventHandler
OnPubSubServiceConnected EventHandler
OnPubSubServiceError EventHandler
OnR9kBeta EventHandler
OnR9kBetaOff EventHandler
OnStreamDown EventHandler
OnStreamUp EventHandler
OnSubscribersOnly EventHandler
OnSubscribersOnlyOff EventHandler
OnTimeout EventHandler
OnUnban EventHandler
OnUntimeout EventHandler
OnViewCount EventHandler
OnWhisper EventHandler

Public Methods

Method Description
Connect ( ) : void

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)

Disconnect ( ) : void

What do you think it does? :)

ListenToBitsEvents ( int channelTwitchId, string channelOAuth ) : void

[TESTED & WORKING] Sends request to listenOn bits events in specific channel

ListenToChatModeratorActions ( int myTwitchId, int channelTwitchId, string moderatorOAuth ) : void

[TESTED & WORKING] Sends a request to listenOn timeouts and bans in a specific channel

ListenToVideoPlayback ( int channelTwitchId ) : void

[UNTESTED] Sends request to listenOn video playback events in specific channel

ListenToWhispers ( int channelTwitchId, string channelOAuth ) : void

Sends request to listen to whispers from specific channel.

TestMessageParser ( string testJsonString ) : void

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

TwitchPubSub ( bool _logging = false ) : System

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

Private Methods

Method Description
OnClose ( object sender, object e ) : void
OnError ( object sender, SuperSocket.ClientEngine.ErrorEventArgs e ) : void
OnMessage ( object sender, WebSocket4Net.MessageReceivedEventArgs e ) : void
OnOpen ( object sender, object e ) : void
generateNonce ( ) : string
listenToTopic ( string topic, string oauth = null, bool unlisten = false ) : void
parseMessage ( string message ) : void
pingTimerTick ( object sender, System e ) : void
unaccountedFor ( string message ) : void

Method Details

Connect() public method

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)
public Connect ( ) : void
return void

Disconnect() public method

What do you think it does? :)
public Disconnect ( ) : void
return void

ListenToBitsEvents() public method

[TESTED & WORKING] Sends request to listenOn bits events in specific channel
public ListenToBitsEvents ( int channelTwitchId, string channelOAuth ) : void
channelTwitchId int Channel Id of channel to listen to bitsOn (can be fetched from TwitchApi)
channelOAuth string OAuth token linked to the channel.
return void

ListenToChatModeratorActions() public method

[TESTED & WORKING] Sends a request to listenOn timeouts and bans in a specific channel
public ListenToChatModeratorActions ( int myTwitchId, int channelTwitchId, string moderatorOAuth ) : void
myTwitchId int A moderator's twitch acount's ID (can be fetched from TwitchApi)
channelTwitchId int Channel ID who has previous parameter's moderator (can be fetched from TwitchApi)
moderatorOAuth string Moderator OAuth key (can be OAuth key with any scope)
return void

ListenToVideoPlayback() public method

[UNTESTED] Sends request to listenOn video playback events in specific channel
public ListenToVideoPlayback ( int channelTwitchId ) : void
channelTwitchId int Channel Id of channel to listen to playback events in.
return void

ListenToWhispers() public method

Sends request to listen to whispers from specific channel.
public ListenToWhispers ( int channelTwitchId, string channelOAuth ) : void
channelTwitchId int Channel to listen to whispers on.
channelOAuth string OAuth token to verify identity.
return void

TestMessageParser() public method

This method will send passed json text to the message parser in order to allow forOn-demand parser testing.
public TestMessageParser ( string testJsonString ) : void
testJsonString string
return void

TwitchPubSub() public method

Constructor for a client that interface's with Twitch's new PubSub system.
public TwitchPubSub ( bool _logging = false ) : System
_logging bool Set this true to have raw messages from PubSub system printed to console.
return System

Property Details

OnBan public_oe property

public EventHandler OnBan
return EventHandler

OnBitsReceived public_oe property

public EventHandler OnBitsReceived
return EventHandler

OnClear public_oe property

public EventHandler OnClear
return EventHandler

OnEmoteOnly public_oe property

public EventHandler OnEmoteOnly
return EventHandler

OnEmoteOnlyOff public_oe property

public EventHandler OnEmoteOnlyOff
return EventHandler

OnHost public_oe property

public EventHandler OnHost
return EventHandler

OnListenResponse public_oe property

public EventHandler OnListenResponse
return EventHandler

OnPubSubServiceClosed public_oe property

public EventHandler OnPubSubServiceClosed
return EventHandler

OnPubSubServiceConnected public_oe property

public EventHandler OnPubSubServiceConnected
return EventHandler

OnPubSubServiceError public_oe property

public EventHandler OnPubSubServiceError
return EventHandler

OnR9kBeta public_oe property

public EventHandler OnR9kBeta
return EventHandler

OnR9kBetaOff public_oe property

public EventHandler OnR9kBetaOff
return EventHandler

OnStreamDown public_oe property

public EventHandler OnStreamDown
return EventHandler

OnStreamUp public_oe property

public EventHandler OnStreamUp
return EventHandler

OnSubscribersOnly public_oe property

public EventHandler OnSubscribersOnly
return EventHandler

OnSubscribersOnlyOff public_oe property

public EventHandler OnSubscribersOnlyOff
return EventHandler

OnTimeout public_oe property

public EventHandler OnTimeout
return EventHandler

OnUnban public_oe property

public EventHandler OnUnban
return EventHandler

OnUntimeout public_oe property

public EventHandler OnUntimeout
return EventHandler

OnViewCount public_oe property

public EventHandler OnViewCount
return EventHandler

OnWhisper public_oe property

public EventHandler OnWhisper
return EventHandler