1using System.Text.RegularExpressions;
2using System.Threading.Tasks;
16 : base(
@"^disable\s+account\s+(?'Name'[^\s]+)$")
23 public override string Name =>
"Disable";
33 public override async Task
Execute(
ChatState State,
string[] Arguments,
string OrgMessage, Match Details,
36 int c = Arguments.Length;
37 string Name = c < 2 ? string.Empty : Arguments[1];
42 await
XmppServerModule.SendErrorMessage(
"An account with name `" +
Name +
"` does not exist.",
string.Empty, ResponseCallback);
45 Account.Enabled =
false;
46 await Persistence.Database.Update(
Account);
47 await ResponseCallback(
"Account `" +
Name +
"` has been disabled.",
string.Empty);
59 new HelpItem(
"disable account NAME",
"Disables an existing account named `NAME`. It is not possible to log into a disabled account.")
DisableAccount()
Disables an account.
override HelpItem[] GetHelp()
Gets help about the command.
override string Name
Command name
override async Task Execute(ChatState State, string[] Arguments, string OrgMessage, Match Details, ResponseCallbackHandler ResponseCallback)
Executes the command.
An administrative command whose syntax is validated with a regular expression.
Contains an item of information about a command.
Contains information about a broker account.
Service Module hosting the XMPP broker and its components.
delegate Task< string > ResponseCallbackHandler(string Markdown, string MessageId)
Delegate for response callback handler methods.