Example #1
0
        //Make sure all the directories and files are here
        public static void Save()
        {
            Configfile newconfig = new Configfile()
            {
                botid = Program.Botid, googleApi = Program.GoogleApi, ownerID = Program.OwnerID, token = Program.Token, nepmote = Program.nepmote, OwnerGithub = Program.OwnerGithub, BotRepo = Program.BotRepo
            };

            Json.CreateJson("config", $"{Program.Rootdir}\\Config", newconfig);
        }
Example #2
0
        public static async Task FindDirectoriesAsync(Log log)
        {
            //Create Directories
            if (!Directory.Exists($"{Program.Rootdir}\\Config"))
            {
                Directory.CreateDirectory($"{Program.Rootdir}\\Config");
            }

            if (!Directory.Exists($"{Program.Rootdir}\\Guilds"))
            {
                Directory.CreateDirectory($"{Program.Rootdir}\\Guilds");
            }

            if (!Directory.Exists($"{Program.Rootdir}\\Music"))
            {
                Directory.CreateDirectory($"{Program.Rootdir}\\Music");
            }

            if (!Directory.Exists($"{Program.Rootdir}\\Personas"))
            {
                Directory.CreateDirectory($"{Program.Rootdir}\\Personas");
            }

            if (!Directory.Exists($"{Program.Rootdir}\\Resources"))
            {
                Directory.CreateDirectory($"{Program.Rootdir}\\Resources");
            }

            if (!Directory.Exists($"{Program.Rootdir}\\Resources\\ffmpeg"))
            {
                Directory.CreateDirectory($"{Program.Rootdir}\\Resources\\ffmpeg");
            }

            if (!Directory.Exists($"{Program.Rootdir}\\Resources\\Fonts"))
            {
                Directory.CreateDirectory($"{Program.Rootdir}\\Resources\\Fonts");
            }

            if (!Directory.Exists($"{Program.Rootdir}\\Resources\\gifsicle"))
            {
                Directory.CreateDirectory($"{Program.Rootdir}\\Resources\\gifsicle");
            }

            if (!Directory.Exists($"{Program.Rootdir}\\Resources\\youtube-dl"))
            {
                Directory.CreateDirectory($"{Program.Rootdir}\\Resources\\youtube-dl");
            }

            if (!Directory.Exists($"{Program.Rootdir}\\Users"))
            {
                Directory.CreateDirectory($"{Program.Rootdir}\\Users");
            }

            if (!Directory.Exists($"{Program.Rootdir}\\Waifus"))
            {
                Directory.CreateDirectory($"{Program.Rootdir}\\Waifus");
            }

            if (!File.Exists($"{Program.Rootdir}\\Config\\config.json"))
            {
                await log.WriteToLog("Config not found, creating");

                Configfile file = new Configfile();
                Json.CreateJson("config", $"{Program.Rootdir}\\Config", file);
            }
            else
            {
                await log.WriteToLog("Config found");
            }

            await Task.CompletedTask;
        }