From 6d2bf5cdd2c5b6e0885109d07fb2f41f9edee3ea Mon Sep 17 00:00:00 2001 From: Alexey Date: Wed, 30 Jul 2025 18:32:38 +0300 Subject: [PATCH] add "about" to scripts you can get a description if you send a request where in params there is a field about with any content --- com/List.lua | 10 ++++++++++ com/Utils/Echo.lua | 10 ++++++++++ com/Utils/Ping.lua | 11 ++++++----- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/com/List.lua b/com/List.lua index f3800f6..5de32cd 100644 --- a/com/List.lua +++ b/com/List.lua @@ -1,5 +1,15 @@ -- com/List.lua +if In.Params and In.Params.about then + Out.Result = { + description = "Returns a list of available methods", + params = { + layer = "select which layer list to display" + } + } + return +end + local function isValidCommand(name) return name:match("^[%w]+$") ~= nil end diff --git a/com/Utils/Echo.lua b/com/Utils/Echo.lua index 1aa98a4..61b2beb 100644 --- a/com/Utils/Echo.lua +++ b/com/Utils/Echo.lua @@ -1,3 +1,13 @@ +if In.Params and In.Params.about then + Out.Result = { + description = "Echo of the message", + params = { + msg = "just message" + } + } + return +end + local function validate() if not In.Params.msg or In.Params.msg == "" then Out.Error = { diff --git a/com/Utils/Ping.lua b/com/Utils/Ping.lua index 561866d..b4a3b97 100644 --- a/com/Utils/Ping.lua +++ b/com/Utils/Ping.lua @@ -1,7 +1,8 @@ -Log.Event("got ping") -Log.EventWarn("got ping") -Log.EventError("got ping") - -Log.Error("mm") +if In.Params and In.Params.about then + Out.Result = { + description = "Just ping" + } + return +end Out.Result.answer = "pong" \ No newline at end of file