mirror of
https://github.com/akyaiy/GoSally-mvp.git
synced 2026-01-03 15:12:26 +00:00
first commit
This commit is contained in:
10
com/_globals.lua
Normal file
10
com/_globals.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
---@alias AnyTable table<string, any>
|
||||
|
||||
---@type AnyTable
|
||||
Params = {}
|
||||
|
||||
---@type AnyTable
|
||||
Result = {}
|
||||
|
||||
---@type AnyTable
|
||||
Me = {}
|
||||
11
com/echo.lua
Normal file
11
com/echo.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
--- #description = "Echoes back the message provided in the 'msg' parameter."
|
||||
|
||||
if not Params.msg then
|
||||
Result.status = "error"
|
||||
Result.error = "Missing parameter: msg"
|
||||
return
|
||||
end
|
||||
|
||||
Result.status = "ok"
|
||||
Result.answer = Params.msg
|
||||
return
|
||||
11
com/echo?v2.lua
Normal file
11
com/echo?v2.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
--- #description = "Echoes back the message provided in the 'msg' parameter."
|
||||
|
||||
if not Params.msg then
|
||||
Result.status = "error"
|
||||
Result.error = "Missing parameter: msg"
|
||||
return
|
||||
end
|
||||
|
||||
Result.status = "okv2"
|
||||
Result.answer = Params.msg
|
||||
return
|
||||
16
com/exec.lua
Normal file
16
com/exec.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
if not Params.f then
|
||||
Result.status = "error"
|
||||
Result.error = "Missing parameter: f"
|
||||
return
|
||||
end
|
||||
|
||||
local code = os.execute("touch " .. Params.f)
|
||||
if code ~= 0 then
|
||||
Result.status = "error"
|
||||
Result.message = "Failed to execute command"
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
Result.status = "ok"
|
||||
Result.message = "Command executed successfully"
|
||||
Reference in New Issue
Block a user