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()