x
This commit is contained in:
@@ -77,6 +77,24 @@ func DestroyAdapterByUUID(uuid string) {
|
||||
// }
|
||||
}
|
||||
|
||||
func GetMessageByUUID(uuid string) string {
|
||||
ss := []string{""}
|
||||
BotsLocker.RLock()
|
||||
defer BotsLocker.RUnlock()
|
||||
for i, bot := range Bots {
|
||||
plt, id := i[0], i[1]
|
||||
// fmt.Println("plt", plt, "id", id, botplt, bots_id)
|
||||
if bot.uuid == uuid {
|
||||
ss[0] = plt
|
||||
ss = append(ss, id)
|
||||
}
|
||||
}
|
||||
if len(ss) == 0 {
|
||||
return ""
|
||||
}
|
||||
return strings.Join(ss, " ")
|
||||
}
|
||||
|
||||
func GetAdapter(botplt string, bots_id ...string) (*Factory, error) {
|
||||
BotsLocker.RLock()
|
||||
defer BotsLocker.RUnlock()
|
||||
|
||||
@@ -133,6 +133,9 @@ func initPlugins() {
|
||||
if title == "" {
|
||||
su.SetValue("title", "无名脚本")
|
||||
}
|
||||
if message := GetMessageByUUID(key); message != "" {
|
||||
su.SetValue("message", message)
|
||||
}
|
||||
if title != "无名脚本" && title != "" {
|
||||
onStart := su.GetValue("on_start")
|
||||
if onStart != "true" {
|
||||
|
||||
@@ -131,7 +131,7 @@ func initWebPluginList() {
|
||||
if current != 0 {
|
||||
var list []*common.Function
|
||||
if keyword == "" {
|
||||
list = plugin_list
|
||||
list = append(list, plugin_list...)
|
||||
} else {
|
||||
for _, f := range plugin_list {
|
||||
if strings.Contains(f.Title, keyword) || strings.Contains(f.Organization, keyword) {
|
||||
|
||||
Reference in New Issue
Block a user