Пример #1
0
        private void OnBotError(object sender, ChatBot.ErrorEventArgs e)
        {
            m_bot?.Dispose();

            m_toggle.IsChecked = false;

            ErrorManager.AddError(new Error(Name, e.ErrorMessage), true);
        }
Пример #2
0
        private void DisconnectFromTwitch()
        {
            if (m_bot?.Connected ?? false)
            {
                m_bot.ConnectedToChannel -= OnBotConnected;
                m_bot.NewMessage         -= OnBotMessage;
                m_bot.Error -= OnBotError;

                m_bot.Dispose();

                m_bot = null;
            }
        }