5 using System.Threading.Tasks;
18 public string Name =>
"revision";
21 public string HelpText =>
"Display live commit sha. Add --repo to view repository revision";
24 public bool AdminOnly =>
false;
43 this.watchdog = watchdog ??
throw new ArgumentNullException(nameof(watchdog));
44 this.repositoryManager = repositoryManager ??
throw new ArgumentNullException(nameof(repositoryManager));
48 public async Task<string>
Invoke(
string arguments,
ChatUser user, CancellationToken cancellationToken)
51 if (arguments.Split(
' ').Any(x => x.ToUpperInvariant() ==
"--REPO"))
52 using (var repo = await repositoryManager.LoadRepository(cancellationToken).ConfigureAwait(
false))
55 return "Repository unavailable!";
61 return "Server offline!";
62 result = watchdog.ActiveCompileJob?.RevisionInformation.CommitSha;
65 return String.Format(CultureInfo.InvariantCulture,
"^{0}", result);
async Task< string > Invoke(string arguments, ChatUser user, CancellationToken cancellationToken)
Invoke the ICommand
Use server authentication
readonly IRepositoryManager repositoryManager
The IRepositoryManager for the PullRequestsCommand
WatchdogStatus
The current status of the watchdog.
readonly IWatchdog watchdog
The IWatchdog for the PullRequestsCommand
Represents a tgs_chat_user datum
For displaying Api.Models.Internal.RevisionInformation
Factory for creating and loading IRepositorys
RevisionCommand(IWatchdog watchdog, IRepositoryManager repositoryManager)
Construct a RevisionCommand
Represents a command that can be invoked by talking to chat bots
Runs and monitors the twin server controllers