A message integration server.
the script will be added as:
type Script struct {
Id string
Name string
Command string //such as "python3 {scriptName} {secretKey} {taskId} {arg1} {arg2}"
Status string
ParamRequired []string
DataReturn []string
}there are two ways to give args to scripts.
you're expected to give a start command with your script uploaded,such aspython3 {scriptName} {arg1} {arg2}.
there are two keys to get information from the server.
{sciptName} to refer the script file name.
{argn} to refer the args that sever given.
{secretKey} to get the server secretKey.
{taskId} to get the task id which is the unique id to match the proc.
{server} to get server address , such as 127.0.0.1:8001.
in the most times,{taskId} and {secretKey} is necessary to callback your data to server
use http://{server}/api/script/{secret_key}/{task_id}/params to get a param per time.
the param is added by user's /addParams {taskId} {arg1} {arg2} ...
use http://{server}/api/script/{secret_key}/{task_id}/sendData to return data to user.
a callback request is defined as:
type Callback struct {
Action string `json:"action"` //"sendText" or "sendPhoto"
Msg string `json:"msg"`
File multipart.File `form:"file"`
}msg is expected as message text sent to user.
file maybe a photo or video or anything.