Esempio n. 1
0
 public Task ExitAsync([Remainder] string Remainder = null)
 {
     if (RainBorg.Operators.Contains(Context.Message.Author.Id))
     {
         RainBorg.ConsoleEventCallback(2);
         Environment.Exit(0);
     }
     return(Task.CompletedTask);
 }
Esempio n. 2
0
        public Task ExitAsync([Remainder] string Remainder = null)
        {
            if (Operators.ContainsKey(Context.Message.Author.Id))
            {
                RainBorg.Log(2, "Command", "Exited by {0}", Context.User.Username);

                RainBorg.ConsoleEventCallback(2);
                Environment.Exit(0);
            }
            return(Task.CompletedTask);
        }
Esempio n. 3
0
        public void RestartAsync([Remainder] string Remainder = null)
        {
            if (Operators.ContainsKey(Context.Message.Author.Id))
            {
                RainBorg.Log("Command", "Restarted by {0}", Context.User.Username);

                RainBorg.Log("RainBorg", "Relaunching bot...");
                RainBorg.Paused = true;
                JObject Resuming = new JObject
                {
                    ["userPools"]    = JToken.FromObject(RainBorg.UserPools),
                    ["greylist"]     = JToken.FromObject(RainBorg.Greylist),
                    ["userMessages"] = JToken.FromObject(RainBorg.UserMessages)
                };
                File.WriteAllText(RainBorg.resumeFile, Resuming.ToString());
                Process.Start("RelaunchUtility.exe", "RainBorg.exe");
                RainBorg.ConsoleEventCallback(2);
                Environment.Exit(0);
            }
        }