private void connectButton_Click(object sender, EventArgs e) { if (!BotEntry.client.Connected) { connectButton.Text = "Connecting..."; BotEntry.client.Username = UsernameTextBox.Text; BotEntry.client.AuthToken = OATokenTextBox.Text; if (Token == null) { Token = new OAuthToken(); } Token.AccessToken = OATokenTextBox.Text; Token.RefreshToken = OATokenTextBox.Text; Token.ExpiresIn = 100; BotEntry.Config.Set(Config.BotSetting.Username, UsernameTextBox.Text); BotEntry.Config.Set(Config.BotSetting.SuperSecretSettings, Token.ToString()); BotEntry.client.Connect(); connectButton.Enabled = false; } else { BotEntry.client.Disconnect(); connectButton.Enabled = false; } }