Exemple #1
0
        private void applyConfigBtn_Click(object sender, EventArgs e)
        {
            SocketGuild guild = guilds[serversCBox.SelectedIndex];

            config        = ServerConfigs.GetConfig(guild);
            config.Prefix = prefixTxt.Text;
            if (afkChanCBox.SelectedIndex != -1)
            {
                SocketVoiceChannel vc = voiceChannels.ToArray()[afkChanCBox.SelectedIndex];
                config.AFKChannelName = vc.Name;
                config.AFKChannelID   = vc.Id;
            }
            config.RequiresVerification = veriToggle.Checked;
            if (veriToggle.Checked)
            {
                config.VerificationRoleID = roles.ToArray()[verRoleCBox.SelectedIndex].Id;
            }
            config.AFKTimeout        = int.Parse(afkTimeCBox.SelectedItem.ToString()) * 60;
            config.EmbedColorRed     = colorPrev.BackColor.R;
            config.EmbedColorGreen   = colorPrev.BackColor.G;
            config.EmbedColorBlue    = colorPrev.BackColor.B;
            config.TimeStamp         = tsToggle.Checked;
            config.AllowAdvertising  = adToggle.Checked;
            config.AntiSpamWarn      = int.Parse(spamWarnTxt.Text);
            config.AntiSpamThreshold = int.Parse(spamThresholdTxt.Text);
            config.AntiSpamTime      = double.Parse(spamTimeTxt.Text);
            config.FooterText        = footerTxt.Text;
            config.NewUserMessage    = newUsrMsgToggle.Checked;
            //SocketTextChannel tc = textChannels.ToArray()[afkChanCBox.SelectedIndex];
            config.NewUserChannel       = textChannels.ToArray()[newUsrChanCBox.SelectedIndex].Id;
            config.BlockMentionEveryone = eMentionTog.Checked;
            config.EnableServerStats    = serverStatsTog.Checked;
            config.EnableLevelSystem    = levelTog.Checked;
            ServerConfigs.SaveAccounts();
            respLbl.Text = "Server Settings Updated!";
        }