From 973c060e5fbb6dc0ceef74975391acb63357ce90 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 23 Jun 2025 13:47:59 +0300 Subject: [PATCH] Refactor echo functionality: add new echo implementation, remove deprecated echo?b1 file, and update preparation script --- com/_prepare.lua | 2 ++ com/{echo?s2.lua => echo.lua} | 4 +++- com/echo?b1.lua | 11 ----------- 3 files changed, 5 insertions(+), 12 deletions(-) rename com/{echo?s2.lua => echo.lua} (74%) delete mode 100644 com/echo?b1.lua diff --git a/com/_prepare.lua b/com/_prepare.lua index 5a2ce63..63b109a 100644 --- a/com/_prepare.lua +++ b/com/_prepare.lua @@ -1,3 +1,5 @@ +package.path = "./com/?.lua;" .. package.path + print = function() end io.write = function(...) end io.stdout = function() return nil end diff --git a/com/echo?s2.lua b/com/echo.lua similarity index 74% rename from com/echo?s2.lua rename to com/echo.lua index c2fb1b6..0b967e2 100644 --- a/com/echo?s2.lua +++ b/com/echo.lua @@ -1,5 +1,7 @@ --- #description = "Echoes back the message provided in the 'msg' parameter." +local mod = require("_for_echo") + if not Params.msg then Result.status = "error" Result.error = "Missing parameter: msg" @@ -7,5 +9,5 @@ if not Params.msg then end Result.status = "ok" -Result.answer = Params.msg +Result.answer = mod.translate(Params.msg) return \ No newline at end of file diff --git a/com/echo?b1.lua b/com/echo?b1.lua deleted file mode 100644 index 5cb7b41..0000000 --- a/com/echo?b1.lua +++ /dev/null @@ -1,11 +0,0 @@ ---- #description = "Echoes back the message provided in the 'msg' parameter. b1" - -if not Params.msg then - Result.status = "error" - Result.error = "Missing parameter: msg" - return -end - -Result.status = "okv2" -Result.answer = Params.msg -return \ No newline at end of file