Required parameters

This commit is contained in:
Cyberboss
2017-09-01 19:46:15 -04:00
parent 71178d0851
commit f8a0f73e44
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -40,11 +40,12 @@ namespace TGServerService
class ServerChatCommand : ChatCommand
{
readonly string HelpText;
public ServerChatCommand(string name, string helpText, bool adminOnly)
public ServerChatCommand(string name, string helpText, bool adminOnly, int requiredParameters)
{
Keyword = name;
RequiresAdmin = adminOnly;
HelpText = helpText;
RequiredParameters = requiredParameters;
}
public override string GetHelpText()
+1 -1
View File
@@ -44,7 +44,7 @@ namespace TGServerService
try
{
foreach(var I in new JavaScriptSerializer().Deserialize<IDictionary<string, IDictionary<string, object>>>(json))
tmp.Add(new ServerChatCommand(I.Key, (string)I.Value["help_text"], (bool)I.Value["adminOnly"]));
tmp.Add(new ServerChatCommand(I.Key, (string)I.Value["help_text"], (bool)I.Value["adminOnly"], (int)I.Value["required_parameters"]));
ServerChatCommands = tmp;
}
catch { }