Exemplo n.º 1
0
 public async Task leave(string serverName = null)
 {
     p.doAction(Context.User, Context.Guild.Id, Program.Module.Settings);
     if (Context.User.Id != Sentences.ownerId)
     {
         await ReplyAsync(Sentences.onlyMasterStr(Context.Guild.Id));
     }
     else
     {
         if (serverName == null)
         {
             await Context.Guild.LeaveAsync();
         }
         else
         {
             IGuild g = p.client.Guilds.ToList().Find(x => x.Name.ToUpper() == serverName.ToUpper());
             if (g == null)
             {
                 await ReplyAsync(Sentences.noCorrespondingGuild(Context.Guild.Id));
             }
             else
             {
                 await g.LeaveAsync();
                 await ReplyAsync(Sentences.doneStr(Context.Guild.Id));
             }
         }
     }
 }
Exemplo n.º 2
0
 public async Task reloadLanguage()
 {
     p.doAction(Context.User, Context.Guild.Id, Program.Module.Settings);
     if (Context.User.Id != Sentences.ownerId)
     {
         await ReplyAsync(Sentences.onlyMasterStr(Context.Guild.Id));
     }
     else
     {
         p.UpdateLanguageFiles();
         await ReplyAsync(Sentences.doneStr(Context.Guild.Id));
     }
 }
Exemplo n.º 3
0
        public async Task archive()
        {
            p.doAction(Context.User, Context.Guild.Id, Program.Module.Settings);
            if (Context.User.Id != 144851584478740481)
            {
                await ReplyAsync(Sentences.onlyMasterStr(Context.Guild.Id));
            }
            else
            {
                await ReplyAsync(Sentences.copyingFiles(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(Context.Guild.Id, currTime));
            }
        }