Beispiel #1
0
        private void btnApplyToken_Click(object sender, EventArgs e)
        {
            DiscordChannel Channel = Service.CheckToken(txtToken.Text).Result;

            if (Channel != null)
            {
                lblGuildName.Text   = Channel.guild;
                lblChannelName.Text = Channel.channel;
                PluginSettings.SetSetting("Token", txtToken.Text);
                PluginSettings.SetSetting("GuildName", lblGuildName.Text);
                PluginSettings.SetSetting("ChannelName", lblChannelName.Text);
            }
            else
            {
                lblGuildName.Text   = "";
                lblChannelName.Text = "";
                txtToken.Text       = "";
                PluginSettings.SetSetting("Token", "");
                PluginSettings.SetSetting("GuildName", "");
                PluginSettings.SetSetting("ChannelName", "");
            }
        }
        private void btnApplyToken_Click(object sender, EventArgs e)
        {
            DiscordChannel Channel = Service.CheckToken(txtToken.Text).Result;

            if (Channel != null)
            {
                LogInfo("Token validated! Parses will be posted to the displayed channel/server.");
                lblGuildName.Text   = Channel.guild;
                lblChannelName.Text = Channel.channel;
                PluginSettings.SetSetting("Token", txtToken.Text);
                PluginSettings.SetSetting("GuildName", lblGuildName.Text);
                PluginSettings.SetSetting("ChannelName", lblChannelName.Text);
            }
            else
            {
                LogInfo("Invalid token. Please check it or re-create it and try again.");
                lblGuildName.Text   = "";
                lblChannelName.Text = "";
                //txtToken.Text = "";
                PluginSettings.SetSetting("Token", "");
                PluginSettings.SetSetting("GuildName", "");
                PluginSettings.SetSetting("ChannelName", "");
            }
        }