x
This commit is contained in:
+2
-1
@@ -28,4 +28,5 @@ develop/core
|
|||||||
*.db
|
*.db
|
||||||
dist/
|
dist/
|
||||||
core/dist
|
core/dist
|
||||||
.verysync
|
.verysync
|
||||||
|
test
|
||||||
+1
-1
@@ -378,7 +378,7 @@ func init() {
|
|||||||
var scripts = map[string]string{}
|
var scripts = map[string]string{}
|
||||||
functions := Functions
|
functions := Functions
|
||||||
for _, function := range functions {
|
for _, function := range functions {
|
||||||
if function.UUID != "" && len(function.Rules) == 0 && !function.OnStart && !function.Module {
|
if function.UUID != "" && len(function.Rules) == 0 && !function.OnStart && !function.Module && function.Http == nil && function.Reply == nil {
|
||||||
scripts[function.UUID] = function.Title + ".js"
|
scripts[function.UUID] = function.Title + ".js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-3
@@ -101,7 +101,7 @@ func initPlugins() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
script := string(fetchScript(p.Address, key))
|
script := string(fetchScript(p.Address, key))
|
||||||
if f, _ := initPlugin(script, p.UUID); f.Cron != "" || f.Module || f.OnStart {
|
if f, _ := initPlugin(script, p.UUID); f.CreateAt != "" {
|
||||||
fin = &storage.Final{
|
fin = &storage.Final{
|
||||||
Now: script,
|
Now: script,
|
||||||
}
|
}
|
||||||
@@ -492,7 +492,7 @@ func initPlugin(data string, uuid string) (*common.Function, error) {
|
|||||||
f.Init(plt, botid)
|
f.Init(plt, botid)
|
||||||
return f
|
return f
|
||||||
})
|
})
|
||||||
vm.Set("GetAdapter", func(plt, botid string) map[string]interface{} {
|
getAdapter := func(plt, botid string) map[string]interface{} {
|
||||||
adapter, err := GetAdapter(plt, botid)
|
adapter, err := GetAdapter(plt, botid)
|
||||||
errstr := ""
|
errstr := ""
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -502,13 +502,21 @@ func initPlugin(data string, uuid string) (*common.Function, error) {
|
|||||||
"error": errstr,
|
"error": errstr,
|
||||||
"adapter": adapter,
|
"adapter": adapter,
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
vm.Set("GetAdapter", getAdapter)
|
||||||
|
vm.Set("getAdapter", getAdapter)
|
||||||
vm.Set("getAdapterBotsID", GetAdapterBotsID)
|
vm.Set("getAdapterBotsID", GetAdapterBotsID)
|
||||||
vm.Set("getAdapterBotPlts", GetAdapterBotPlts)
|
vm.Set("getAdapterBotPlts", GetAdapterBotPlts)
|
||||||
|
vm.Set("GetAdapterBotsID", GetAdapterBotsID)
|
||||||
|
vm.Set("GetAdapterBotPlts", GetAdapterBotPlts)
|
||||||
vm.Set("running", running)
|
vm.Set("running", running)
|
||||||
|
vm.Set("Running", running)
|
||||||
vm.Set("uuid", func() string {
|
vm.Set("uuid", func() string {
|
||||||
return uuid
|
return uuid
|
||||||
})
|
})
|
||||||
|
vm.Set("UUID", func() string {
|
||||||
|
return uuid
|
||||||
|
})
|
||||||
if set != nil {
|
if set != nil {
|
||||||
set(vm)
|
set(vm)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user