Beispiel #1
0
        private void EditToken()
        {
            while (true)
            {
                string token = ConfigPropertyEditor.EditField <ConfigFile>(nameof(Config.bot.BotToken), Config.bot);

                if (string.IsNullOrWhiteSpace(token))
                {
                    System.Console.WriteLine("A token must be imputed!");
                    continue;
                }

                Config.SaveConfig();

                if (string.IsNullOrWhiteSpace(Global.BotToken))
                {
                    Global.BotToken = token;
                }
                else
                {
                    System.Console.WriteLine("You will need to restart the bot to use the new token!");
                }
                break;
            }
        }
Beispiel #2
0
        private void EditSteamKey()
        {
            ConfigPropertyEditor.EditField <ConfigApis>(nameof(Config.bot.Apis.ApiSteamKey), Config.bot.Apis);

            Config.SaveConfig();

            System.Console.WriteLine("The bot will now use the new Steam API key provided on next restart.");
        }
Beispiel #3
0
        private void EditGoogleEngineId()
        {
            ConfigPropertyEditor.EditField <ConfigApis>(nameof(Config.bot.Apis.GoogleSearchEngineId), Config.bot.Apis);

            Config.SaveConfig();

            System.Console.WriteLine("The bot will now use the new Google Engine ID provided.");
        }
Beispiel #4
0
        private void EditGiphy()
        {
            ConfigPropertyEditor.EditField <ConfigApis>(nameof(Config.bot.Apis.ApiGiphyKey), Config.bot.Apis);

            Config.SaveConfig();

            System.Console.WriteLine("The bot will now use the new Giphy API key provided.");
        }
Beispiel #5
0
        private void EditName()
        {
            while (true)
            {
                string name = ConfigPropertyEditor.EditField <ConfigFile>(nameof(Config.bot.BotName), Config.bot);

                if (string.IsNullOrWhiteSpace(name))
                {
                    System.Console.WriteLine("A name must be imputed!");
                    continue;
                }

                Config.SaveConfig();
                Global.BotName = name;
                break;
            }
        }
Beispiel #6
0
        private void EditPrefix()
        {
            while (true)
            {
                string prefix = ConfigPropertyEditor.EditField <ConfigFile>(nameof(Config.bot.BotPrefix), Config.bot);

                if (string.IsNullOrWhiteSpace(prefix))
                {
                    System.Console.WriteLine("A prefix must be imputed!");
                    continue;
                }

                Config.SaveConfig();
                Global.BotPrefix = prefix;
                break;
            }
        }