2using System.Globalization;
5using System.Threading.Tasks;
20 public string Name =>
"revision";
23 public string HelpText =>
"Display live origin commit sha. Add --repo to view repository revision";
45 this.watchdog =
watchdog ??
throw new ArgumentNullException(nameof(
watchdog));
50 public async ValueTask<MessageContent>
Invoke(
string arguments,
ChatUser user, CancellationToken cancellationToken)
53 if (arguments.Split(
' ').Any(x => x.Equals(
"--repo", StringComparison.OrdinalIgnoreCase)))
58 Text =
"Repository busy! Try again later",
65 Text =
"Repository unavailable!",
74 Text =
"Server offline!",
81 Text = String.Format(CultureInfo.InvariantCulture,
"^{0}", result),
Represents a tgs_chat_user datum.
For displaying Api.Models.Internal.RevisionInformation.
string Name
The text to invoke the command. May not be "?" or "help" (case-insensitive).
bool AdminOnly
If the command should only be available to ChatUsers who's ChatUser.Channel has ChannelRepresentation...
RevisionCommand(IWatchdog watchdog, IRepositoryManager repositoryManager)
Initializes a new instance of the RevisionCommand class.
string HelpText
The help text to display when queires are made about the command.
async ValueTask< MessageContent > Invoke(string arguments, ChatUser user, CancellationToken cancellationToken)
Invoke the ICommand.A ValueTask<TResult> resulting in a MessageContent to send to the invoker.
readonly IRepositoryManager repositoryManager
The IRepositoryManager for the PullRequestsCommand.
readonly IWatchdog watchdog
The IWatchdog for the PullRequestsCommand.
Represents a message to send to a chat provider.
Represents a command that can be invoked by talking to chat bots.
Factory for creating and loading IRepositorys.
bool CloneInProgress
If a CloneRepository(Uri, string, string, string, JobProgressReporter, bool, CancellationToken) opera...
ValueTask< IRepository?> LoadRepository(CancellationToken cancellationToken)
Attempt to load the IRepository from the default location.
bool InUse
If something is holding a lock on the repository.
Runs and monitors the twin server controllers.
Models.? CompileJob ActiveCompileJob
Retrieves the Models.CompileJob currently running on the server.
WatchdogStatus Status
The current WatchdogStatus.
WatchdogStatus
The current status of the watchdog.