tgstation-server
6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
src
Tgstation.Server.Host
Components
Chat
Commands
VersionCommand.cs
Go to the documentation of this file.
1
using
System;
2
using
System.Threading;
3
using
System.Threading.Tasks;
4
5
using
Tgstation.Server.Host.Components.Interop
;
6
using
Tgstation.Server.Host.System
;
7
8
namespace
Tgstation.Server.Host.Components.Chat.Commands
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
27
readonly
IAssemblyInformationProvider
assemblyInformationProvider
;
28
33
public
VersionCommand
(
IAssemblyInformationProvider
assemblyInformationProvider
)
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
{
41
Text =
assemblyInformationProvider
.
VersionString
,
42
});
43
}
44
}
Tgstation.Server.Host.Components.Chat.ChatUser
Represents a tgs_chat_user datum.
Definition
ChatUser.cs:12
Tgstation.Server.Host.Components.Chat.Commands.VersionCommand
ICommand to return the IAssemblyInformationProvider.VersionString.
Definition
VersionCommand.cs:14
Tgstation.Server.Host.Components.Chat.Commands.VersionCommand.assemblyInformationProvider
readonly IAssemblyInformationProvider assemblyInformationProvider
The IAssemblyInformationProvider for the VersionCommand.
Definition
VersionCommand.cs:27
Tgstation.Server.Host.Components.Chat.Commands.VersionCommand.Name
string Name
The text to invoke the command. May not be "?" or "help" (case-insensitive).
Definition
VersionCommand.cs:16
Tgstation.Server.Host.Components.Chat.Commands.VersionCommand.AdminOnly
bool AdminOnly
If the command should only be available to ChatUsers who's ChatUser.Channel has ChannelRepresentation...
Definition
VersionCommand.cs:22
Tgstation.Server.Host.Components.Chat.Commands.VersionCommand.VersionCommand
VersionCommand(IAssemblyInformationProvider assemblyInformationProvider)
Initializes a new instance of the VersionCommand class.
Definition
VersionCommand.cs:33
Tgstation.Server.Host.Components.Chat.Commands.VersionCommand.Invoke
ValueTask< MessageContent > Invoke(string arguments, ChatUser user, CancellationToken cancellationToken)
Invoke the ICommand.A ValueTask<TResult> resulting in a MessageContent to send to the invoker.
Tgstation.Server.Host.Components.Chat.Commands.VersionCommand.HelpText
string HelpText
The help text to display when queires are made about the command.
Definition
VersionCommand.cs:19
Tgstation.Server.Host.Components.Interop.MessageContent
Represents a message to send to a chat provider.
Definition
MessageContent.cs:7
Tgstation.Server.Host.Components.Chat.Commands.ICommand
Represents a command that can be invoked by talking to chat bots.
Definition
ICommand.cs:12
Tgstation.Server.Host.System.IAssemblyInformationProvider
For retrieving the Assembly's location.
Definition
IAssemblyInformationProvider.cs:11
Tgstation.Server.Host.System.IAssemblyInformationProvider.VersionString
string VersionString
A more verbose version of Version.
Definition
IAssemblyInformationProvider.cs:30
Tgstation.Server.Host.Components.Chat.Commands
Definition
CommandFactory.cs:12
Tgstation.Server.Host.Components.Interop
Definition
BridgeCommandType.cs:2
Tgstation.Server.Host.System
Definition
AssemblyInformationProvider.cs:9
Generated by
1.9.8