x
This commit is contained in:
+2
-1
@@ -28,4 +28,5 @@ develop/core
|
||||
*.db
|
||||
dist/
|
||||
core/dist
|
||||
.verysync
|
||||
.verysync
|
||||
test
|
||||
+1
-1
@@ -378,7 +378,7 @@ func init() {
|
||||
var scripts = map[string]string{}
|
||||
functions := 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"
|
||||
}
|
||||
}
|
||||
|
||||
+11
-3
@@ -101,7 +101,7 @@ func initPlugins() {
|
||||
continue
|
||||
}
|
||||
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{
|
||||
Now: script,
|
||||
}
|
||||
@@ -492,7 +492,7 @@ func initPlugin(data string, uuid string) (*common.Function, error) {
|
||||
f.Init(plt, botid)
|
||||
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)
|
||||
errstr := ""
|
||||
if err != nil {
|
||||
@@ -502,13 +502,21 @@ func initPlugin(data string, uuid string) (*common.Function, error) {
|
||||
"error": errstr,
|
||||
"adapter": adapter,
|
||||
}
|
||||
})
|
||||
}
|
||||
vm.Set("GetAdapter", getAdapter)
|
||||
vm.Set("getAdapter", getAdapter)
|
||||
vm.Set("getAdapterBotsID", GetAdapterBotsID)
|
||||
vm.Set("getAdapterBotPlts", GetAdapterBotPlts)
|
||||
vm.Set("GetAdapterBotsID", GetAdapterBotsID)
|
||||
vm.Set("GetAdapterBotPlts", GetAdapterBotPlts)
|
||||
vm.Set("running", running)
|
||||
vm.Set("Running", running)
|
||||
vm.Set("uuid", func() string {
|
||||
return uuid
|
||||
})
|
||||
vm.Set("UUID", func() string {
|
||||
return uuid
|
||||
})
|
||||
if set != nil {
|
||||
set(vm)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user