tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
VersionCommand.cs
Go to the documentation of this file.
1using System;
2using System.Threading;
3using System.Threading.Tasks;
4
7
9{
13 sealed class VersionCommand : ICommand
14 {
16 public string Name => "version";
17
19 public string HelpText => "Displays the tgstation server version";
20
22 public bool AdminOnly => false;
23
28
34 {
35 this.assemblyInformationProvider = assemblyInformationProvider ?? throw new ArgumentNullException(nameof(assemblyInformationProvider));
36 }
37
39 public ValueTask<MessageContent> Invoke(string arguments, ChatUser user, CancellationToken cancellationToken) => ValueTask.FromResult(new MessageContent
40 {
42 });
43 }
44}
Represents a tgs_chat_user datum.
Definition ChatUser.cs:12
ICommand to return the IAssemblyInformationProvider.VersionString.
readonly IAssemblyInformationProvider assemblyInformationProvider
The IAssemblyInformationProvider for the VersionCommand.
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...
VersionCommand(IAssemblyInformationProvider assemblyInformationProvider)
Initializes a new instance of the VersionCommand class.
ValueTask< MessageContent > Invoke(string arguments, ChatUser user, CancellationToken cancellationToken)
Invoke the ICommand.A ValueTask<TResult> resulting in a MessageContent to send to the invoker.
string HelpText
The help text to display when queires are made about the command.
Represents a message to send to a chat provider.
Represents a command that can be invoked by talking to chat bots.
Definition ICommand.cs:12