This commit is contained in:
1-6
2023-07-13 20:27:10 +08:00
parent a3fb6a5da4
commit 7777fb73cd
6 changed files with 195 additions and 20 deletions
+17
View File
@@ -365,6 +365,23 @@ func SetPluginMethod(vm *goja.Runtime, uuid string, on_start bool, running func(
vm: vm,
})
vm.Set("createNickName", CreateNickName)
vm.Set("getListenOnGroups", func(plt string) []string {
groups := []string{}
ListenOnGroups.Range(func(key, value any) bool {
if value == plt {
groups = append(groups, key.(string))
}
return true
})
StaticListenOnGroups.Range(func(key, value any) bool {
if value == plt {
groups = append(groups, key.(string))
}
return true
})
groups = utils.Unique(groups)
return groups
})
}
func EncryptPlugin(script string) string {