5 using System.Threading.Tasks;
18 public string Name =>
"byond";
21 public string HelpText =>
"Displays the running Byond version. Use --active for the version used in future deployments";
24 public bool AdminOnly =>
false;
43 this.byondManager = byondManager ??
throw new ArgumentNullException(nameof(byondManager));
44 this.watchdog = watchdog ??
throw new ArgumentNullException(nameof(watchdog));
48 public Task<string>
Invoke(
string arguments,
ChatUser user, CancellationToken cancellationToken)
50 if (arguments.Split(
' ').Any(x => x.ToUpperInvariant() ==
"--ACTIVE"))
51 return Task.FromResult(byondManager.ActiveVersion == null ?
"None!" : String.Format(CultureInfo.InvariantCulture,
"{0}.{1}", byondManager.ActiveVersion.Major, byondManager.ActiveVersion.Minor));
53 return Task.FromResult(
"Server offline!");
54 return Task.FromResult(watchdog.ActiveCompileJob.ByondVersion);
readonly IByondManager byondManager
The IByondManager for the ByondCommand
WatchdogStatus
The current status of the watchdog.
Task< string > Invoke(string arguments, ChatUser user, CancellationToken cancellationToken)
Invoke the ICommand
For managing the BYOND installation
Represents a tgs_chat_user datum
For displaying the installed Byond version
readonly IWatchdog watchdog
The IWatchdog for the ByondCommand
Represents a command that can be invoked by talking to chat bots
Runs and monitors the twin server controllers
ByondCommand(IByondManager byondManager, IWatchdog watchdog)
Construct a ByondCommand