5 using System.Threading.Tasks;
17 public string Name =>
"byond";
20 public string HelpText =>
"Displays the running Byond version. Use --active for the version used in future deployments";
23 public bool AdminOnly =>
false;
42 this.byondManager = byondManager ??
throw new ArgumentNullException(nameof(byondManager));
43 this.watchdog = watchdog ??
throw new ArgumentNullException(nameof(watchdog));
47 public Task<string>
Invoke(
string arguments,
ChatUser user, CancellationToken cancellationToken)
49 if (arguments.Split(
' ').Any(x => x.ToUpperInvariant() ==
"--ACTIVE"))
50 return Task.FromResult(byondManager.ActiveVersion == null ?
"None!" : String.Format(CultureInfo.InvariantCulture,
"{0}.{1}", byondManager.ActiveVersion.Major, byondManager.ActiveVersion.Minor));
51 if (!watchdog.Running)
52 return Task.FromResult(
"Server offline!");
53 return Task.FromResult(watchdog.ActiveCompileJob.ByondVersion);
readonly IByondManager byondManager
The IByondManager for the ByondCommand
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