x
This commit is contained in:
@@ -191,11 +191,13 @@ func GetAdapterBotPlts() []string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (f *Factory) Init(botplt, botid string, params map[string]interface{}) {
|
func (f *Factory) Init(botplt, botid string, params map[string]interface{}) {
|
||||||
|
// fmt.Println(params)
|
||||||
if params != nil {
|
if params != nil {
|
||||||
if _, ok := params["umod"]; ok {
|
if _, ok := params["umod"]; ok {
|
||||||
f.umod = true
|
f.umod = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// fmt.Println("umod", f.umod)
|
||||||
f.ctx, f.cancel = context.WithCancel(context.Background())
|
f.ctx, f.cancel = context.WithCancel(context.Background())
|
||||||
BotsLocker.Lock()
|
BotsLocker.Lock()
|
||||||
defer BotsLocker.Unlock()
|
defer BotsLocker.Unlock()
|
||||||
|
|||||||
+2
-2
@@ -543,12 +543,12 @@ func initPlugin(data string, uuid string) (*common.Function, []func(), error) {
|
|||||||
f.Init(plt, botid, params)
|
f.Init(plt, botid, params)
|
||||||
return f
|
return f
|
||||||
})
|
})
|
||||||
vm.Set("initAdapter", func(plt, botid string) *Factory {
|
vm.Set("initAdapter", func(plt, botid string, params map[string]interface{}) *Factory {
|
||||||
f := &Factory{
|
f := &Factory{
|
||||||
uuid: uuid,
|
uuid: uuid,
|
||||||
vm: vm,
|
vm: vm,
|
||||||
}
|
}
|
||||||
f.Init(plt, botid, nil)
|
f.Init(plt, botid, params)
|
||||||
return f
|
return f
|
||||||
})
|
})
|
||||||
getAdapter := func(plt, botid string) map[string]interface{} {
|
getAdapter := func(plt, botid string) map[string]interface{} {
|
||||||
|
|||||||
Reference in New Issue
Block a user