![]() |
TwitchLib 3.5.3
|
Represents a client connected to a Twitch channel. Implements the TwitchLib.Client.Interfaces.ITwitchClient More...
Public Member Functions | |
| TwitchClient (IClient client=null, ClientProtocol protocol=ClientProtocol.WebSocket, ILogger< TwitchClient > logger=null) | |
| Initializes the TwitchChatClient class. More... | |
| void | Initialize (ConnectionCredentials credentials, string channel=null, char chatCommandIdentifier='!', char whisperCommandIdentifier='!', bool autoReListenOnExceptions=true) |
| Initializes the TwitchChatClient class. More... | |
| void | Initialize (ConnectionCredentials credentials, List< string > channels, char chatCommandIdentifier='!', char whisperCommandIdentifier='!', bool autoReListenOnExceptions=true) |
| Initializes the TwitchChatClient class (with multiple channels). More... | |
| void | SendRaw (string message) |
| Sends a RAW IRC message. More... | |
| void | SendMessage (JoinedChannel channel, string message, bool dryRun=false) |
| Sends a formatted Twitch channel chat message. More... | |
| void | SendMessage (string channel, string message, bool dryRun=false) |
| SendMessage wrapper that accepts channel in string form. More... | |
| void | SendReply (JoinedChannel channel, string replyToId, string message, bool dryRun=false) |
| Sends a formatted Twitch chat message reply. More... | |
| void | SendReply (string channel, string replyToId, string message, bool dryRun=false) |
| SendReply wrapper that accepts channel in string form. More... | |
| void | SendWhisper (string receiver, string message, bool dryRun=false) |
| Sends a formatted whisper message to someone. More... | |
| bool | Connect () |
| Start connecting to the Twitch IRC chat. More... | |
| void | Disconnect () |
| Start disconnecting from the Twitch IRC chat. More... | |
| void | Reconnect () |
| Start reconnecting to the Twitch IRC chat. More... | |
| void | AddChatCommandIdentifier (char identifier) |
| Adds a character to a list of characters that if found at the start of a message, fires command received event. More... | |
| void | RemoveChatCommandIdentifier (char identifier) |
| Removes a character from a list of characters that if found at the start of a message, fires command received event. More... | |
| void | AddWhisperCommandIdentifier (char identifier) |
| Adds a character to a list of characters that if found at the start of a whisper, fires command received event. More... | |
| void | RemoveWhisperCommandIdentifier (char identifier) |
| Removes a character to a list of characters that if found at the start of a whisper, fires command received event. More... | |
| void | SetConnectionCredentials (ConnectionCredentials credentials) |
| Sets the connection credentials. More... | |
| void | JoinChannel (string channel, bool overrideCheck=false) |
| Join the Twitch IRC chat of channel . More... | |
| JoinedChannel | GetJoinedChannel (string channel) |
| Returns a JoinedChannel object using a passed string/>. More... | |
| void | LeaveChannel (string channel) |
| Leaves (PART) the Twitch IRC chat of channel . More... | |
| void | LeaveChannel (JoinedChannel channel) |
| Leaves (PART) the Twitch IRC chat of channel . More... | |
| void | OnReadLineTest (string rawIrc) |
| This method allows firing the message parser with a custom irc string allowing for easy testing More... | |
| void | SendQueuedItem (string message) |
| Sends the queued item. More... | |
| void | Initialize (ConnectionCredentials credentials, string channel=null, char chatCommandIdentifier='!', char whisperCommandIdentifier='!', bool autoReListenOnExceptions=true) |
| Initializes the specified credentials. More... | |
| void | Initialize (ConnectionCredentials credentials, List< string > channels, char chatCommandIdentifier='!', char whisperCommandIdentifier='!', bool autoReListenOnExceptions=true) |
| Initializes the specified credentials. More... | |
| void | SetConnectionCredentials (ConnectionCredentials credentials) |
| Sets the connection credentials. More... | |
| void | AddChatCommandIdentifier (char identifier) |
| Adds the chat command identifier. More... | |
| void | AddWhisperCommandIdentifier (char identifier) |
| Adds the whisper command identifier. More... | |
| void | RemoveChatCommandIdentifier (char identifier) |
| Removes the chat command identifier. More... | |
| void | RemoveWhisperCommandIdentifier (char identifier) |
| Removes the whisper command identifier. More... | |
| bool | Connect () |
| Connects this instance. More... | |
| void | Disconnect () |
| Disconnects this instance. More... | |
| void | Reconnect () |
| Reconnects this instance. More... | |
| JoinedChannel | GetJoinedChannel (string channel) |
| Gets the joined channel. More... | |
| void | JoinChannel (string channel, bool overrideCheck=false) |
| Joins the channel. More... | |
| void | LeaveChannel (JoinedChannel channel) |
| Leaves the channel. More... | |
| void | LeaveChannel (string channel) |
| Leaves the channel. More... | |
| void | OnReadLineTest (string rawIrc) |
| Called when [read line test]. More... | |
| void | SendMessage (JoinedChannel channel, string message, bool dryRun=false) |
| Sends the message. More... | |
| void | SendMessage (string channel, string message, bool dryRun=false) |
| Sends the message. More... | |
| void | SendReply (JoinedChannel channel, string replyToId, string message, bool dryRun=false) |
| Sends a formatted Twitch chat message reply. More... | |
| void | SendReply (string channel, string replyToId, string message, bool dryRun=false) |
| SendReply wrapper that accepts channel in string form. More... | |
| void | SendQueuedItem (string message) |
| Sends the queued item. More... | |
| void | SendRaw (string message) |
| Sends the raw. More... | |
| void | SendWhisper (string receiver, string message, bool dryRun=false) |
| Sends the whisper. More... | |
Static Protected Member Functions | |
| static void | HandleNotInitialized () |
| Handles the not initialized. More... | |
| static void | HandleNotConnected () |
| Handles the not connected. More... | |
Properties | |
| Version | Version [get] |
| Assembly version of TwitchLib.Client. More... | |
| bool | IsInitialized [get] |
| Checks if underlying client has been initialized. More... | |
| IReadOnlyList< JoinedChannel > | JoinedChannels [get] |
| A list of all channels the client is currently in. More... | |
| string | TwitchUsername [get] |
| Username of the user connected via this library. More... | |
| WhisperMessage | PreviousWhisper [get] |
| The most recent whisper received. More... | |
| bool | IsConnected [get] |
| The current connection status of the client. More... | |
| MessageEmoteCollection | ChannelEmotes [get] |
| The emotes this channel replaces. More... | |
| bool | DisableAutoPong = false [get, set] |
| Will disable the client from sending automatic PONG responses to PING More... | |
| bool | WillReplaceEmotes = false [get, set] |
| Determines whether Emotes will be replaced in messages. More... | |
| ConnectionCredentials | ConnectionCredentials [get] |
| Provides access to connection credentials object. More... | |
| bool | AutoReListenOnException [get, set] |
| Provides access to autorelistiononexception on off boolean. More... | |
Properties inherited from TwitchLib.Client.Interfaces.ITwitchClient | |
| bool | AutoReListenOnException [get, set] |
| Gets or sets a value indicating whether [automatic re listen on exception]. More... | |
| MessageEmoteCollection | ChannelEmotes [get] |
| Gets the channel emotes. More... | |
| ConnectionCredentials | ConnectionCredentials [get] |
| Gets the connection credentials. More... | |
| bool | DisableAutoPong [get, set] |
| Gets or sets a value indicating whether [disable automatic pong]. More... | |
| bool | IsConnected [get] |
| Gets a value indicating whether this instance is connected. More... | |
| bool | IsInitialized [get] |
| Gets a value indicating whether this instance is initialized. More... | |
| IReadOnlyList< JoinedChannel > | JoinedChannels [get] |
| Gets the joined channels. More... | |
| WhisperMessage | PreviousWhisper [get] |
| Gets the previous whisper. More... | |
| string | TwitchUsername [get] |
| Gets the twitch username. More... | |
| bool | WillReplaceEmotes [get, set] |
| Gets or sets a value indicating whether [will replace emotes]. More... | |
Events | |
| EventHandler< OnAnnouncementArgs > | OnAnnouncement |
| Fires when an Announcement is received More... | |
| EventHandler< OnVIPsReceivedArgs > | OnVIPsReceived |
| Fires when VIPs are received from chat More... | |
| EventHandler< OnLogArgs > | OnLog |
| Fires whenever a log write happens. More... | |
| EventHandler< OnConnectedArgs > | OnConnected |
| Fires when client connects to Twitch. More... | |
| EventHandler< OnJoinedChannelArgs > | OnJoinedChannel |
| Fires when client joins a channel. More... | |
| EventHandler< OnIncorrectLoginArgs > | OnIncorrectLogin |
| Fires on logging in with incorrect details, returns ErrorLoggingInException. More... | |
| EventHandler< OnChannelStateChangedArgs > | OnChannelStateChanged |
| Fires when connecting and channel state is changed, returns ChannelState. More... | |
| EventHandler< OnUserStateChangedArgs > | OnUserStateChanged |
| Fires when a user state is received, returns UserState. More... | |
| EventHandler< OnMessageReceivedArgs > | OnMessageReceived |
| Fires when a new chat message arrives, returns ChatMessage. More... | |
| EventHandler< OnWhisperReceivedArgs > | OnWhisperReceived |
| Fires when a new whisper arrives, returns WhisperMessage. More... | |
| EventHandler< OnMessageSentArgs > | OnMessageSent |
| Fires when a chat message is sent, returns username, channel and message. More... | |
| EventHandler< OnWhisperSentArgs > | OnWhisperSent |
| Fires when a whisper message is sent, returns username and message. More... | |
| EventHandler< OnChatCommandReceivedArgs > | OnChatCommandReceived |
| Fires when command (uses custom chat command identifier) is received, returns channel, command, ChatMessage, arguments as string, arguments as list. More... | |
| EventHandler< OnWhisperCommandReceivedArgs > | OnWhisperCommandReceived |
| Fires when command (uses custom whisper command identifier) is received, returns command, Whispermessage. More... | |
| EventHandler< OnUserJoinedArgs > | OnUserJoined |
| Fires when a new viewer/chatter joined the channel's chat room, returns username and channel. More... | |
| EventHandler< OnModeratorJoinedArgs > | OnModeratorJoined |
| Fires when a moderator joined the channel's chat room, returns username and channel. More... | |
| EventHandler< OnModeratorLeftArgs > | OnModeratorLeft |
| Fires when a moderator joins the channel's chat room, returns username and channel. More... | |
| EventHandler< OnMessageClearedArgs > | OnMessageCleared |
| Fires when a message gets deleted in chat. More... | |
| EventHandler< OnNewSubscriberArgs > | OnNewSubscriber |
| Fires when new subscriber is announced in chat, returns Subscriber. More... | |
| EventHandler< OnReSubscriberArgs > | OnReSubscriber |
| Fires when current subscriber renews subscription, returns ReSubscriber. More... | |
| EventHandler< OnPrimePaidSubscriberArgs > | OnPrimePaidSubscriber |
| Fires when a current Prime gaming subscriber converts to a paid subscription. More... | |
| EventHandler< OnExistingUsersDetectedArgs > | OnExistingUsersDetected |
| Fires when Twitch notifies client of existing users in chat. More... | |
| EventHandler< OnUserLeftArgs > | OnUserLeft |
| Fires when a PART message is received from Twitch regarding a particular viewer More... | |
| EventHandler< OnDisconnectedEventArgs > | OnDisconnected |
| Fires when bot has disconnected. More... | |
| EventHandler< OnConnectionErrorArgs > | OnConnectionError |
| Forces when bot suffers connection error. More... | |
| EventHandler< OnChatClearedArgs > | OnChatCleared |
| Fires when a channel's chat is cleared. More... | |
| EventHandler< OnUserTimedoutArgs > | OnUserTimedout |
| Fires when a viewer gets timedout by any moderator. More... | |
| EventHandler< OnLeftChannelArgs > | OnLeftChannel |
| Fires when client successfully leaves a channel. More... | |
| EventHandler< OnUserBannedArgs > | OnUserBanned |
| Fires when a viewer gets banned by any moderator. More... | |
| EventHandler< OnModeratorsReceivedArgs > | OnModeratorsReceived |
| Fires when a list of moderators is received. More... | |
| EventHandler< OnChatColorChangedArgs > | OnChatColorChanged |
| Fires when confirmation of a chat color change request was received. More... | |
| EventHandler< OnSendReceiveDataArgs > | OnSendReceiveData |
| Fires when data is either received or sent. More... | |
| EventHandler< OnRaidNotificationArgs > | OnRaidNotification |
| Fires when a raid notification is detected in chat More... | |
| EventHandler< OnGiftedSubscriptionArgs > | OnGiftedSubscription |
| Fires when a subscription is gifted and announced in chat More... | |
| EventHandler< OnCommunitySubscriptionArgs > | OnCommunitySubscription |
| Fires when a community subscription is announced in chat More... | |
| EventHandler< OnContinuedGiftedSubscriptionArgs > | OnContinuedGiftedSubscription |
| EventHandler< OnMessageThrottledEventArgs > | OnMessageThrottled |
| Fires when a Message has been throttled. More... | |
| EventHandler< OnWhisperThrottledEventArgs > | OnWhisperThrottled |
| Fires when a Whisper has been throttled. More... | |
| EventHandler< OnErrorEventArgs > | OnError |
| Occurs when an Error is thrown in the protocol client More... | |
| EventHandler< OnReconnectedEventArgs > | OnReconnected |
| Occurs when a reconnection occurs. More... | |
| EventHandler< OnRequiresVerifiedEmailArgs > | OnRequiresVerifiedEmail |
| Occurs when chatting in a channel that requires a verified email without a verified email attached to the account. More... | |
| EventHandler< OnRequiresVerifiedPhoneNumberArgs > | OnRequiresVerifiedPhoneNumber |
| Occurs when chatting in a channel that requires a verified phone number without a verified phone number attached to the account. More... | |
| EventHandler< OnRateLimitArgs > | OnRateLimit |
| Occurs when send message rate limit has been applied to the client in a specific channel by Twitch More... | |
| EventHandler< OnDuplicateArgs > | OnDuplicate |
| Occurs when sending duplicate messages and user is not permitted to do so More... | |
| EventHandler< OnBannedEmailAliasArgs > | OnBannedEmailAlias |
| Occurs when chatting in a channel that the user is banned in bcs of an already banned alias with the same Email More... | |
| EventHandler | OnSelfRaidError |
| Fires when TwitchClient attempts to host a channel it is in. More... | |
| EventHandler | OnNoPermissionError |
| Fires when TwitchClient receives generic no permission error from Twitch. More... | |
| EventHandler | OnRaidedChannelIsMatureAudience |
| Fires when newly raided channel is mature audience only. More... | |
| EventHandler< OnFailureToReceiveJoinConfirmationArgs > | OnFailureToReceiveJoinConfirmation |
| Fires when the client was unable to join a channel. More... | |
| EventHandler< OnFollowersOnlyArgs > | OnFollowersOnly |
| Fires when the client attempts to send a message to a channel in followers only mode, as a non-follower More... | |
| EventHandler< OnSubsOnlyArgs > | OnSubsOnly |
| Fires when the client attempts to send a message to a channel in subs only mode, as a non-sub More... | |
| EventHandler< OnEmoteOnlyArgs > | OnEmoteOnly |
| Fires when the client attempts to send a non-emote message to a channel in emotes only mode More... | |
| EventHandler< OnSuspendedArgs > | OnSuspended |
| Fires when the client attempts to send a message to a channel that has been suspended More... | |
| EventHandler< OnBannedArgs > | OnBanned |
| Fires when the client attempts to send a message to a channel they're banned in More... | |
| EventHandler< OnSlowModeArgs > | OnSlowMode |
| Fires when the client attempts to send a message in a channel with slow mode enabled, without cooldown expiring More... | |
| EventHandler< OnR9kModeArgs > | OnR9kMode |
| Fires when the client attempts to send a message in a channel with r9k mode enabled, and message was not permitted More... | |
| EventHandler< OnUserIntroArgs > | OnUserIntro |
| Fires when the client receives a PRIVMSG tagged as an user-intro More... | |
| EventHandler< OnUnaccountedForArgs > | OnUnaccountedFor |
| Fires when data is received from Twitch that is not able to be parsed. More... | |
Events inherited from TwitchLib.Client.Interfaces.ITwitchClient | |
| EventHandler< OnChannelStateChangedArgs > | OnChannelStateChanged |
| Occurs when [on channel state changed]. More... | |
| EventHandler< OnChatClearedArgs > | OnChatCleared |
| Occurs when [on chat cleared]. More... | |
| EventHandler< OnChatColorChangedArgs > | OnChatColorChanged |
| Occurs when [on chat color changed]. More... | |
| EventHandler< OnChatCommandReceivedArgs > | OnChatCommandReceived |
| Occurs when [on chat command received]. More... | |
| EventHandler< OnConnectedArgs > | OnConnected |
| Occurs when [on connected]. More... | |
| EventHandler< OnConnectionErrorArgs > | OnConnectionError |
| Occurs when [on connection error]. More... | |
| EventHandler< OnDisconnectedEventArgs > | OnDisconnected |
| Occurs when [on disconnected]. More... | |
| EventHandler< OnExistingUsersDetectedArgs > | OnExistingUsersDetected |
| Occurs when [on existing users detected]. More... | |
| EventHandler< OnGiftedSubscriptionArgs > | OnGiftedSubscription |
| Occurs when [on gifted subscription]. More... | |
| EventHandler< OnIncorrectLoginArgs > | OnIncorrectLogin |
| Occurs when [on incorrect login]. More... | |
| EventHandler< OnJoinedChannelArgs > | OnJoinedChannel |
| Occurs when [on joined channel]. More... | |
| EventHandler< OnLeftChannelArgs > | OnLeftChannel |
| Occurs when [on left channel]. More... | |
| EventHandler< OnLogArgs > | OnLog |
| Occurs when [on log]. More... | |
| EventHandler< OnMessageReceivedArgs > | OnMessageReceived |
| Occurs when [on message received]. More... | |
| EventHandler< OnMessageSentArgs > | OnMessageSent |
| Occurs when [on message sent]. More... | |
| EventHandler< OnModeratorJoinedArgs > | OnModeratorJoined |
| Occurs when [on moderator joined]. More... | |
| EventHandler< OnModeratorLeftArgs > | OnModeratorLeft |
| Occurs when [on moderator left]. More... | |
| EventHandler< OnModeratorsReceivedArgs > | OnModeratorsReceived |
| Occurs when [on moderators received]. More... | |
| EventHandler< OnNewSubscriberArgs > | OnNewSubscriber |
| Occurs when [on new subscriber]. More... | |
| EventHandler< OnRaidNotificationArgs > | OnRaidNotification |
| Occurs when [on raid notification]. More... | |
| EventHandler< OnReSubscriberArgs > | OnReSubscriber |
| Occurs when [on re subscriber]. More... | |
| EventHandler< OnSendReceiveDataArgs > | OnSendReceiveData |
| Occurs when [on send receive data]. More... | |
| EventHandler< OnUserBannedArgs > | OnUserBanned |
| Occurs when [on user banned]. More... | |
| EventHandler< OnUserJoinedArgs > | OnUserJoined |
| Occurs when [on user joined]. More... | |
| EventHandler< OnUserLeftArgs > | OnUserLeft |
| Occurs when [on user left]. More... | |
| EventHandler< OnUserStateChangedArgs > | OnUserStateChanged |
| Occurs when [on user state changed]. More... | |
| EventHandler< OnUserTimedoutArgs > | OnUserTimedout |
| Occurs when [on user timedout]. More... | |
| EventHandler< OnWhisperCommandReceivedArgs > | OnWhisperCommandReceived |
| Occurs when [on whisper command received]. More... | |
| EventHandler< OnWhisperReceivedArgs > | OnWhisperReceived |
| Occurs when [on whisper received]. More... | |
| EventHandler< OnWhisperSentArgs > | OnWhisperSent |
| Occurs when [on whisper sent]. More... | |
| EventHandler< OnMessageThrottledEventArgs > | OnMessageThrottled |
| Occurs when [on message throttled]. More... | |
| EventHandler< OnWhisperThrottledEventArgs > | OnWhisperThrottled |
| Occurs when [on whisper throttled]. More... | |
| EventHandler< OnErrorEventArgs > | OnError |
| Occurs when [on error]. More... | |
| EventHandler< OnReconnectedEventArgs > | OnReconnected |
| Occurs when [on reconnected]. More... | |
| EventHandler< OnVIPsReceivedArgs > | OnVIPsReceived |
| Occurs when [on vip received]. More... | |
| EventHandler< OnCommunitySubscriptionArgs > | OnCommunitySubscription |
| Occurs when [on community subscription announcement received]. More... | |
| EventHandler< OnMessageClearedArgs > | OnMessageCleared |
| Occurs when [on message deleted]. More... | |
| EventHandler< OnRequiresVerifiedEmailArgs > | OnRequiresVerifiedEmail |
| Occurs when chatting in a channel that requires a verified email without a verified email attached to the account. More... | |
| EventHandler< OnRequiresVerifiedPhoneNumberArgs > | OnRequiresVerifiedPhoneNumber |
| Occurs when chatting in a channel that requires a verified phone number without a verified phone number attached to the account. More... | |
| EventHandler< OnBannedEmailAliasArgs > | OnBannedEmailAlias |
| Occurs when chatting in a channel that the user is banned in bcs of an already banned alias with the same Email More... | |
| EventHandler< OnUserIntroArgs > | OnUserIntro |
| Fires when the client receives a PRIVMSG tagged as an user-intro More... | |
| EventHandler< OnAnnouncementArgs > | OnAnnouncement |
| Fires when the client receives a USERNOTICE tagged as an announcement More... | |
Represents a client connected to a Twitch channel. Implements the TwitchLib.Client.Interfaces.ITwitchClient
| TwitchLib.Client.TwitchClient.TwitchClient | ( | IClient | client = null, |
| ClientProtocol | protocol = ClientProtocol.WebSocket, |
||
| ILogger< TwitchClient > | logger = null |
||
| ) |
Initializes the TwitchChatClient class.
| client | Protocol Client to use for connection from TwitchLib.Communication. Possible Options Are the TcpClient client or WebSocket client. |
| protocol | The protocol. |
| logger | Optional ILogger instance to enable logging |
| void TwitchLib.Client.TwitchClient.AddChatCommandIdentifier | ( | char | identifier | ) |
Adds a character to a list of characters that if found at the start of a message, fires command received event.
| identifier | Character, that if found at start of message, fires command received event. |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.AddWhisperCommandIdentifier | ( | char | identifier | ) |
Adds a character to a list of characters that if found at the start of a whisper, fires command received event.
| identifier | Character, that if found at start of message, fires command received event. |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| bool TwitchLib.Client.TwitchClient.Connect | ( | ) |
Start connecting to the Twitch IRC chat.
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.Disconnect | ( | ) |
Start disconnecting from the Twitch IRC chat.
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| JoinedChannel TwitchLib.Client.TwitchClient.GetJoinedChannel | ( | string | channel | ) |
Returns a JoinedChannel object using a passed string/>.
| channel | String channel to search for. |
| TwitchLib.Client.Exceptions.BadStateException | Must be connected to at least one channel. |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
|
staticprotected |
Handles the not connected.
| TwitchLib.Client.Exceptions.ClientNotConnectedException | In order to perform this action, the client must be connected to Twitch. To confirm connection, try performing this action in or after the OnConnected event has been fired. |
|
staticprotected |
Handles the not initialized.
| TwitchLib.Client.Exceptions.ClientNotInitializedException | The twitch client has not been initialized and cannot be used. Please call Initialize(); |
| void TwitchLib.Client.TwitchClient.Initialize | ( | ConnectionCredentials | credentials, |
| List< string > | channels, | ||
| char | chatCommandIdentifier = '!', |
||
| char | whisperCommandIdentifier = '!', |
||
| bool | autoReListenOnExceptions = true |
||
| ) |
Initializes the TwitchChatClient class (with multiple channels).
| credentials | The credentials to use to log in. |
| channels | List of channels to join when connected |
| chatCommandIdentifier | The identifier to be used for reading and writing commands from chat. |
| whisperCommandIdentifier | The identifier to be used for reading and writing commands from whispers. |
| autoReListenOnExceptions | By default, TwitchClient will silence exceptions and auto-relisten for overall stability. For debugging, you may wish to have the exception bubble up, set this to false. |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.Initialize | ( | ConnectionCredentials | credentials, |
| string | channel = null, |
||
| char | chatCommandIdentifier = '!', |
||
| char | whisperCommandIdentifier = '!', |
||
| bool | autoReListenOnExceptions = true |
||
| ) |
Initializes the TwitchChatClient class.
| credentials | The credentials to use to log in. |
| channel | The channel to connect to. |
| chatCommandIdentifier | The identifier to be used for reading and writing commands from chat. |
| whisperCommandIdentifier | The identifier to be used for reading and writing commands from whispers. |
| autoReListenOnExceptions | By default, TwitchClient will silence exceptions and auto-relisten for overall stability. For debugging, you may wish to have the exception bubble up, set this to false. |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.JoinChannel | ( | string | channel, |
| bool | overrideCheck = false |
||
| ) |
Join the Twitch IRC chat of channel .
| channel | The channel to join. |
| overrideCheck | Override a join check. |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.LeaveChannel | ( | JoinedChannel | channel | ) |
Leaves (PART) the Twitch IRC chat of channel .
| channel | The JoinedChannel object to leave. |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.LeaveChannel | ( | string | channel | ) |
Leaves (PART) the Twitch IRC chat of channel .
| channel | The channel to leave. |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.OnReadLineTest | ( | string | rawIrc | ) |
This method allows firing the message parser with a custom irc string allowing for easy testing
| rawIrc | This should be a raw IRC message resembling one received from Twitch IRC. |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.Reconnect | ( | ) |
Start reconnecting to the Twitch IRC chat.
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.RemoveChatCommandIdentifier | ( | char | identifier | ) |
Removes a character from a list of characters that if found at the start of a message, fires command received event.
| identifier | Command identifier to removed from identifier list. |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.RemoveWhisperCommandIdentifier | ( | char | identifier | ) |
Removes a character to a list of characters that if found at the start of a whisper, fires command received event.
| identifier | Command identifier to removed from identifier list. |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.SendMessage | ( | JoinedChannel | channel, |
| string | message, | ||
| bool | dryRun = false |
||
| ) |
Sends a formatted Twitch channel chat message.
| channel | Channel to send message to. |
| message | The message to be sent. |
| dryRun | If set to true, the message will not actually be sent for testing purposes. |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.SendMessage | ( | string | channel, |
| string | message, | ||
| bool | dryRun = false |
||
| ) |
SendMessage wrapper that accepts channel in string form.
| channel | The channel. |
| message | The message. |
| dryRun | if set to true [dry run]. |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.SendQueuedItem | ( | string | message | ) |
Sends the queued item.
| message | The message. |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.SendRaw | ( | string | message | ) |
Sends a RAW IRC message.
| message | The RAW message to be sent. |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.SendReply | ( | JoinedChannel | channel, |
| string | replyToId, | ||
| string | message, | ||
| bool | dryRun = false |
||
| ) |
Sends a formatted Twitch chat message reply.
| channel | Channel to send Twitch chat reply to |
| replyToId | The message id that is being replied to |
| message | Reply contents |
| dryRun | if set to true [dry run] |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.SendReply | ( | string | channel, |
| string | replyToId, | ||
| string | message, | ||
| bool | dryRun = false |
||
| ) |
SendReply wrapper that accepts channel in string form.
| channel | Channel to send Twitch chat reply to |
| replyToId | The message id that is being replied to |
| message | Reply contents |
| dryRun | if set to true [dry run] |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.SendWhisper | ( | string | receiver, |
| string | message, | ||
| bool | dryRun = false |
||
| ) |
Sends a formatted whisper message to someone.
| receiver | The receiver of the whisper. |
| message | The message to be sent. |
| dryRun | If set to true, the message will not actually be sent for testing purposes. |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| void TwitchLib.Client.TwitchClient.SetConnectionCredentials | ( | ConnectionCredentials | credentials | ) |
Sets the connection credentials.
| credentials | The credentials. |
| TwitchLib.Client.Exceptions.IllegalAssignmentException | While the client is connected, you are unable to change the connection credentials. Please disconnect first and then change them. |
Implements TwitchLib.Client.Interfaces.ITwitchClient.
|
getset |
Provides access to autorelistiononexception on off boolean.
true if [automatic re listen on exception]; otherwise, false.
Implements TwitchLib.Client.Interfaces.ITwitchClient.
|
get |
The emotes this channel replaces.
The channel emotes.
Twitch-handled emotes are automatically added to this collection (which also accounts for managing user emote permissions such as sub-only emotes). Third-party emotes will have to be manually added according to the availability rules defined by the third-party.
Implements TwitchLib.Client.Interfaces.ITwitchClient.
|
get |
Provides access to connection credentials object.
The connection credentials.
Implements TwitchLib.Client.Interfaces.ITwitchClient.
|
getset |
Will disable the client from sending automatic PONG responses to PING
true if [disable automatic pong]; otherwise, false.
Implements TwitchLib.Client.Interfaces.ITwitchClient.
|
get |
The current connection status of the client.
true if this instance is connected; otherwise, false.
Implements TwitchLib.Client.Interfaces.ITwitchClient.
|
get |
Checks if underlying client has been initialized.
true if this instance is initialized; otherwise, false.
Implements TwitchLib.Client.Interfaces.ITwitchClient.
|
get |
A list of all channels the client is currently in.
The joined channels.
Implements TwitchLib.Client.Interfaces.ITwitchClient.
|
get |
The most recent whisper received.
The previous whisper.
Implements TwitchLib.Client.Interfaces.ITwitchClient.
|
get |
Username of the user connected via this library.
The twitch username.
Implements TwitchLib.Client.Interfaces.ITwitchClient.
|
get |
Assembly version of TwitchLib.Client.
The version.
|
getset |
Determines whether Emotes will be replaced in messages.
true if [will replace emotes]; otherwise, false.
Implements TwitchLib.Client.Interfaces.ITwitchClient.
| EventHandler<OnAnnouncementArgs> TwitchLib.Client.TwitchClient.OnAnnouncement |
Fires when an Announcement is received
| EventHandler<OnBannedArgs> TwitchLib.Client.TwitchClient.OnBanned |
Fires when the client attempts to send a message to a channel they're banned in
| EventHandler<OnBannedEmailAliasArgs> TwitchLib.Client.TwitchClient.OnBannedEmailAlias |
Occurs when chatting in a channel that the user is banned in bcs of an already banned alias with the same Email
| EventHandler<OnChannelStateChangedArgs> TwitchLib.Client.TwitchClient.OnChannelStateChanged |
Fires when connecting and channel state is changed, returns ChannelState.
| EventHandler<OnChatClearedArgs> TwitchLib.Client.TwitchClient.OnChatCleared |
Fires when a channel's chat is cleared.
| EventHandler<OnChatColorChangedArgs> TwitchLib.Client.TwitchClient.OnChatColorChanged |
Fires when confirmation of a chat color change request was received.
| EventHandler<OnChatCommandReceivedArgs> TwitchLib.Client.TwitchClient.OnChatCommandReceived |
Fires when command (uses custom chat command identifier) is received, returns channel, command, ChatMessage, arguments as string, arguments as list.
| EventHandler<OnCommunitySubscriptionArgs> TwitchLib.Client.TwitchClient.OnCommunitySubscription |
Fires when a community subscription is announced in chat
| EventHandler<OnConnectedArgs> TwitchLib.Client.TwitchClient.OnConnected |
Fires when client connects to Twitch.
| EventHandler<OnConnectionErrorArgs> TwitchLib.Client.TwitchClient.OnConnectionError |
Forces when bot suffers connection error.
| EventHandler<OnContinuedGiftedSubscriptionArgs> TwitchLib.Client.TwitchClient.OnContinuedGiftedSubscription |
| EventHandler<OnDisconnectedEventArgs> TwitchLib.Client.TwitchClient.OnDisconnected |
Fires when bot has disconnected.
| EventHandler<OnDuplicateArgs> TwitchLib.Client.TwitchClient.OnDuplicate |
Occurs when sending duplicate messages and user is not permitted to do so
| EventHandler<OnEmoteOnlyArgs> TwitchLib.Client.TwitchClient.OnEmoteOnly |
Fires when the client attempts to send a non-emote message to a channel in emotes only mode
| EventHandler<OnErrorEventArgs> TwitchLib.Client.TwitchClient.OnError |
Occurs when an Error is thrown in the protocol client
| EventHandler<OnExistingUsersDetectedArgs> TwitchLib.Client.TwitchClient.OnExistingUsersDetected |
Fires when Twitch notifies client of existing users in chat.
| EventHandler<OnFailureToReceiveJoinConfirmationArgs> TwitchLib.Client.TwitchClient.OnFailureToReceiveJoinConfirmation |
Fires when the client was unable to join a channel.
| EventHandler<OnFollowersOnlyArgs> TwitchLib.Client.TwitchClient.OnFollowersOnly |
Fires when the client attempts to send a message to a channel in followers only mode, as a non-follower
| EventHandler<OnGiftedSubscriptionArgs> TwitchLib.Client.TwitchClient.OnGiftedSubscription |
Fires when a subscription is gifted and announced in chat
| EventHandler<OnIncorrectLoginArgs> TwitchLib.Client.TwitchClient.OnIncorrectLogin |
Fires on logging in with incorrect details, returns ErrorLoggingInException.
| EventHandler<OnJoinedChannelArgs> TwitchLib.Client.TwitchClient.OnJoinedChannel |
Fires when client joins a channel.
| EventHandler<OnLeftChannelArgs> TwitchLib.Client.TwitchClient.OnLeftChannel |
Fires when client successfully leaves a channel.
| EventHandler<OnLogArgs> TwitchLib.Client.TwitchClient.OnLog |
Fires whenever a log write happens.
| EventHandler<OnMessageClearedArgs> TwitchLib.Client.TwitchClient.OnMessageCleared |
Fires when a message gets deleted in chat.
| EventHandler<OnMessageReceivedArgs> TwitchLib.Client.TwitchClient.OnMessageReceived |
Fires when a new chat message arrives, returns ChatMessage.
| EventHandler<OnMessageSentArgs> TwitchLib.Client.TwitchClient.OnMessageSent |
Fires when a chat message is sent, returns username, channel and message.
| EventHandler<OnMessageThrottledEventArgs> TwitchLib.Client.TwitchClient.OnMessageThrottled |
Fires when a Message has been throttled.
| EventHandler<OnModeratorJoinedArgs> TwitchLib.Client.TwitchClient.OnModeratorJoined |
Fires when a moderator joined the channel's chat room, returns username and channel.
| EventHandler<OnModeratorLeftArgs> TwitchLib.Client.TwitchClient.OnModeratorLeft |
Fires when a moderator joins the channel's chat room, returns username and channel.
| EventHandler<OnModeratorsReceivedArgs> TwitchLib.Client.TwitchClient.OnModeratorsReceived |
Fires when a list of moderators is received.
| EventHandler<OnNewSubscriberArgs> TwitchLib.Client.TwitchClient.OnNewSubscriber |
Fires when new subscriber is announced in chat, returns Subscriber.
| EventHandler TwitchLib.Client.TwitchClient.OnNoPermissionError |
Fires when TwitchClient receives generic no permission error from Twitch.
| EventHandler<OnPrimePaidSubscriberArgs> TwitchLib.Client.TwitchClient.OnPrimePaidSubscriber |
Fires when a current Prime gaming subscriber converts to a paid subscription.
| EventHandler<OnR9kModeArgs> TwitchLib.Client.TwitchClient.OnR9kMode |
Fires when the client attempts to send a message in a channel with r9k mode enabled, and message was not permitted
| EventHandler TwitchLib.Client.TwitchClient.OnRaidedChannelIsMatureAudience |
Fires when newly raided channel is mature audience only.
| EventHandler<OnRaidNotificationArgs> TwitchLib.Client.TwitchClient.OnRaidNotification |
Fires when a raid notification is detected in chat
| EventHandler<OnRateLimitArgs> TwitchLib.Client.TwitchClient.OnRateLimit |
Occurs when send message rate limit has been applied to the client in a specific channel by Twitch
| EventHandler<OnReconnectedEventArgs> TwitchLib.Client.TwitchClient.OnReconnected |
Occurs when a reconnection occurs.
| EventHandler<OnRequiresVerifiedEmailArgs> TwitchLib.Client.TwitchClient.OnRequiresVerifiedEmail |
Occurs when chatting in a channel that requires a verified email without a verified email attached to the account.
| EventHandler<OnRequiresVerifiedPhoneNumberArgs> TwitchLib.Client.TwitchClient.OnRequiresVerifiedPhoneNumber |
Occurs when chatting in a channel that requires a verified phone number without a verified phone number attached to the account.
| EventHandler<OnReSubscriberArgs> TwitchLib.Client.TwitchClient.OnReSubscriber |
Fires when current subscriber renews subscription, returns ReSubscriber.
| EventHandler TwitchLib.Client.TwitchClient.OnSelfRaidError |
Fires when TwitchClient attempts to host a channel it is in.
| EventHandler<OnSendReceiveDataArgs> TwitchLib.Client.TwitchClient.OnSendReceiveData |
Fires when data is either received or sent.
| EventHandler<OnSlowModeArgs> TwitchLib.Client.TwitchClient.OnSlowMode |
Fires when the client attempts to send a message in a channel with slow mode enabled, without cooldown expiring
| EventHandler<OnSubsOnlyArgs> TwitchLib.Client.TwitchClient.OnSubsOnly |
Fires when the client attempts to send a message to a channel in subs only mode, as a non-sub
| EventHandler<OnSuspendedArgs> TwitchLib.Client.TwitchClient.OnSuspended |
Fires when the client attempts to send a message to a channel that has been suspended
| EventHandler<OnUnaccountedForArgs> TwitchLib.Client.TwitchClient.OnUnaccountedFor |
Fires when data is received from Twitch that is not able to be parsed.
| EventHandler<OnUserBannedArgs> TwitchLib.Client.TwitchClient.OnUserBanned |
Fires when a viewer gets banned by any moderator.
| EventHandler<OnUserIntroArgs> TwitchLib.Client.TwitchClient.OnUserIntro |
Fires when the client receives a PRIVMSG tagged as an user-intro
| EventHandler<OnUserJoinedArgs> TwitchLib.Client.TwitchClient.OnUserJoined |
Fires when a new viewer/chatter joined the channel's chat room, returns username and channel.
| EventHandler<OnUserLeftArgs> TwitchLib.Client.TwitchClient.OnUserLeft |
Fires when a PART message is received from Twitch regarding a particular viewer
| EventHandler<OnUserStateChangedArgs> TwitchLib.Client.TwitchClient.OnUserStateChanged |
Fires when a user state is received, returns UserState.
| EventHandler<OnUserTimedoutArgs> TwitchLib.Client.TwitchClient.OnUserTimedout |
Fires when a viewer gets timedout by any moderator.
| EventHandler<OnVIPsReceivedArgs> TwitchLib.Client.TwitchClient.OnVIPsReceived |
Fires when VIPs are received from chat
| EventHandler<OnWhisperCommandReceivedArgs> TwitchLib.Client.TwitchClient.OnWhisperCommandReceived |
Fires when command (uses custom whisper command identifier) is received, returns command, Whispermessage.
| EventHandler<OnWhisperReceivedArgs> TwitchLib.Client.TwitchClient.OnWhisperReceived |
Fires when a new whisper arrives, returns WhisperMessage.
| EventHandler<OnWhisperSentArgs> TwitchLib.Client.TwitchClient.OnWhisperSent |
Fires when a whisper message is sent, returns username and message.
| EventHandler<OnWhisperThrottledEventArgs> TwitchLib.Client.TwitchClient.OnWhisperThrottled |
Fires when a Whisper has been throttled.