diff --git a/core/adapter.go b/core/adapter.go index 7c440be..77b3956 100644 --- a/core/adapter.go +++ b/core/adapter.go @@ -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() diff --git a/core/plugin_core.go b/core/plugin_core.go index d8ea54f..4dccf52 100644 --- a/core/plugin_core.go +++ b/core/plugin_core.go @@ -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" { diff --git a/core/plugin_subscribe.go b/core/plugin_subscribe.go index 48ee7cf..16cabcf 100644 --- a/core/plugin_subscribe.go +++ b/core/plugin_subscribe.go @@ -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) {