Exemplo n.º 1
0
        /// <summary>
        /// Starts the bot. Auto-connects to bot's Twitch account
        /// </summary>
        public void Start()
        {
            if (IsConnectionAlive)
            {
                _logger.LogWarning("Cant start the bot! Bot is already running.");
                return;
            }

            var connected = Connect();

            if (!connected)
            {
                return;
            }

            // Immediatelly start primary timer
            this.readingTimer.Change(0, 200);

            // Start points timer
            if (!_pointsManager.IsTimerRunning)
            {
                _pointsManager.StartPointsTimer();
            }

            // Start experience timer
            if (!_experienceManager.TimerRunning)
            {
                _experienceManager.StartExperienceTimer();
            }

            this.uptime.Start();
            this.uptimeTimer.Change(0, 1000);
            IsBotRunning = true;
            _logger.LogInformation("Bot started.");
        }