Example #1
0
        private async void metroButton8_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrWhiteSpace(metroTextBox10.Text))
            {
                return;
            }
            metroButton8.Enabled  = false;
            metroButton10.Enabled = false;
            _chatId     = 0;
            label4.Text = null;
            _chatId     = await TelegramApi.GetChatIdViaUsername(metroTextBox10.Text);

            if (_chatId != 0)
            {
                label4.Text           = @"Deine Chat Id lautet " + _chatId + @".";
                label4.ForeColor      = Color.Green;
                metroButton10.Enabled = true;
            }
            else
            {
                label4.Text      = @"Deine Chat Id konnte nicht gefunden werden. Bitte wiederhole den vorgang oder Kontakte den Entwickler.";
                label4.ForeColor = Color.Red;
            }
            metroButton8.Enabled = true;
        }