tgstation-server
The /tg/station 13 server suite
VersionCommand.cs
Go to the documentation of this file.
1 using System;
2 using System.Threading;
3 using System.Threading.Tasks;
5 
6 namespace Tgstation.Server.Host.Components.Chat.Commands
7 {
11  sealed class VersionCommand : ICommand
12  {
14  public string Name => "version";
15 
17  public string HelpText => "Displays the tgstation server version";
18 
20  public bool AdminOnly => false;
21 
26 
31  public VersionCommand(IApplication application)
32  {
33  this.application = application ?? throw new ArgumentNullException(nameof(application));
34  }
35 
37  public Task<string> Invoke(string arguments, User user, CancellationToken cancellationToken) => Task.FromResult(application.VersionString);
38  }
39 }
Configures the ASP.NET Core web application
Definition: IApplication.cs:8
ICommand to return the IApplication.VersionString
readonly IApplication application
The IApplication for the VersionCommand
VersionCommand(IApplication application)
Construct a VersionCommand
Represents a tgs_chat_user datum
Definition: User.cs:10
Represents a command that can be invoked by talking to chat bots
Definition: ICommand.cs:9