This commit is contained in:
cdle
2023-06-12 22:57:36 +08:00
parent 9e3c8ed10f
commit 4354ff80b2
3 changed files with 22 additions and 1 deletions
+18
View File
@@ -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()
+3
View File
@@ -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" {
+1 -1
View File
@@ -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) {