Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Cmd.cs
1using System.Threading.Tasks;
2
4{
8 public class Cmd : CommandNoParameters
9 {
13 public Cmd()
14 {
15 }
16
20 public override string Name => "Cmd";
21
25 public override string[] Aliases => new string[] { "Shell" };
26
34 public override async Task Execute(ChatState State, string[] Arguments, string OrgMessage, ResponseCallbackHandler ResponseCallback)
35 {
36 if (State.CommandMode)
37 await ResponseCallback("Already in command prompt (shell) mode.", string.Empty);
38 else
39 {
40 State.CommandMode = true;
41 await ResponseCallback("Now in command prompt (shell) mode.", string.Empty);
42 }
43 }
44
48 public override string[] HelpParagraphs => new string[] { "Enters command prompt (shell) mode." };
49 }
50}
bool CommandMode
Shell Command mode (true), or internal mode (false, default).
Definition: ChatState.cs:21
An administrative command with no parameters.
Shell command mode.
Definition: Cmd.cs:9
override string[] HelpParagraphs
Markdown description of syntax.
Definition: Cmd.cs:48
Cmd()
Shell command mode.
Definition: Cmd.cs:13
override string[] Aliases
Optional set of aliases. Can be null.
Definition: Cmd.cs:25
override string Name
Command name
Definition: Cmd.cs:20
override async Task Execute(ChatState State, string[] Arguments, string OrgMessage, ResponseCallbackHandler ResponseCallback)
Executes the command.
Definition: Cmd.cs:34
delegate Task< string > ResponseCallbackHandler(string Markdown, string MessageId)
Delegate for response callback handler methods.