Ejemplo n.º 1
0
        public void Run(MessageCreateEventArgs e)
        {
            var msgSplit = e.Message.Content.Split(new char[] { ' ' });

            var message = new StringBuilder();

            message.Append("```");
            try
            {
                using (var git = new clsGit())
                {
                    if (msgSplit.Length > 1)
                    {
                        git.Switch(msgSplit[1]);
                    }
                    message.AppendLine(git.ToString());
                }
            }
            catch (Exception ex)
            {
                message.AppendLine($"Error: {ex.Message}");
            }

            message.Append("```");


            if (msgSplit.Length > 1)
            {
                message.AppendLine("`bot update` required to pull branch.");
            }

            e.Channel.SendMessageAsync(message.ToString());
        }
Ejemplo n.º 2
0
 static public string CheckForUpdate()
 {
     try
     {
         using (var git = new clsGit())
         {
             return(git.Head.RemoteSha != GitCommitHash?git.Head.ToString() : null);
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine($"CheckForUpdate Error:{ex.Message}");
         return(null);
     }
 }