From f8a0f73e4428e68b0a17ed9b4e952c1511c5ca18 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Fri, 1 Sep 2017 19:46:15 -0400 Subject: [PATCH] Required parameters --- TGServerService/ChatCommands.cs | 3 ++- TGServerService/Interop.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/TGServerService/ChatCommands.cs b/TGServerService/ChatCommands.cs index 3ea26883d3..f0a8d42ec6 100644 --- a/TGServerService/ChatCommands.cs +++ b/TGServerService/ChatCommands.cs @@ -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() diff --git a/TGServerService/Interop.cs b/TGServerService/Interop.cs index 072d6aebda..48b2d7953a 100644 --- a/TGServerService/Interop.cs +++ b/TGServerService/Interop.cs @@ -44,7 +44,7 @@ namespace TGServerService try { foreach(var I in new JavaScriptSerializer().Deserialize>>(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 { }