Ejemplo n.º 1
0
        /// <summary>
        /// Chat Service Authenticated Event Handler.
        /// Add authenticated account to collection to be used as message sender on success.
        /// Adds authentication successful or failure system message to chat message collection.
        /// </summary>
        private void _chatService_Authenticated(object sender, ChatConnectionAuthenticatedEventArgs e)
        {
            if (e.IsAuthenticated)
            {
                // Add authenticated account to chat account collection
                AddChatAccount(e.Account);

                // Add success message in console
                AddChatMessage(new TwitchChatMessage(
                                   string.Format("{0} successfully authenticated, have fun!", e.Account.Username),
                                   "Oakbot")
                               );

                // If bot account is authenticated
                if (!e.Account.IsCaster)
                {
                    // Set system connected status
                    IsSystemConnected = true;
                }
            }
            else
            {
                // Add failure message in console
                AddChatMessage(new TwitchChatMessage(
                                   string.Format("{0} failed to authenticate, please relink with Twitch!", e.Account.Username),
                                   "Oakbot")
                               );
            }
        }
Ejemplo n.º 2
0
 private void _ccs_Authenticated(object sender, ChatConnectionAuthenticatedEventArgs e)
 {
     if (e.IsAuthenticated)
     {
         // Set connected state for UI
         if (e.Account.IsCaster)
         {
             IsCasterConnected = true;
         }
         else
         {
             IsBotConnected = true;
             _wse.BroadcastEvent("OAKBOT_CHAT_CONNECTED", new { name = e.Account.Username });
         }
     }
 }