Beispiel #1
0
 public async Task WhoAreYou()
 {
     increaseMessage(Context);
     p.doAction(Context.User, Context.Guild.Id, Program.Module.Communication);
     if (File.ReadAllLines("Saves/Servers/" + Context.Guild.Id + "/serverDatas.dat")[4] == "0")
     {
         await ReplyAsync(Sentences.moduleDisabledStr);
     }
     else
     {
         string memoryDate = File.ReadAllLines("Saves/sanaraDatas.dat")[0];
         string getDate    = memoryDate.Substring(0, 2) + "/" + memoryDate.Substring(2, 2) + "/" + memoryDate.Substring(4, 2) +
                             " at " + memoryDate.Substring(6, 2) + ":" + memoryDate.Substring(8, 2) + ":" + memoryDate.Substring(10, 2);
         await ReplyAsync(Sentences.whoIAmStr(getDate));
     }
 }
Beispiel #2
0
        public async Task archive()
        {
            p.doAction(Context.User, Context.Guild.Id, Program.Module.Settings);
            if (Context.User.Id != 144851584478740481)
            {
                await ReplyAsync(Sentences.onlyMasterStr);
            }
            else
            {
                await ReplyAsync("Please let me some time so I can copy all my files.");

                p.saveDatas(Context.Guild.Id);
                if (!Directory.Exists("Archives"))
                {
                    Directory.CreateDirectory("Archives");
                }
                string currTime = DateTime.UtcNow.ToString("yy-MM-dd-HH-mm-ss");
                Directory.CreateDirectory("Archives/" + currTime);
                copyContent("Saves", "Archives/" + currTime);
                await ReplyAsync(Sentences.createArchiveStr(currTime));
            }
        }