Exemplo n.º 1
0
 private void _ccs_Disconnected(object sender, ChatConnectionDisconnectedEventArgs e)
 {
     // Set flag for UI notification
     if (e.Account.IsCaster)
     {
         IsCasterConnected = false;
     }
     else
     {
         IsBotConnected = false;
         _wse.BroadcastEvent("OAKBOT_CHAT_DISCONNECTED", new { name = e.Account.Username });
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Chat Service Disconnected Event Handler.
        /// Removes disconnected account from collection to be used as message sender.
        /// Adds disconnection system message to chat message collection.
        /// </summary>
        private void _chatService_Disconnected(object sender, ChatConnectionDisconnectedEventArgs e)
        {
            // Remove disconnected account from chat account collection
            RemoveChatAccount(e.Account);

            // Add disconnection message to console
            AddChatMessage(new TwitchChatMessage(
                               string.Format("{0} disconnected from the chat.", e.Account.Username),
                               "OakBot"));

            // If bot is disconnected
            if (!e.Account.IsCaster)
            {
                // Set system connected status
                IsSystemConnected = false;
            }
        }